Use left-margin to center dashboard elements #192
This commit is contained in:
parent
c4ea986f5a
commit
a6199b1ed2
1 changed files with 9 additions and 4 deletions
|
@ -116,15 +116,20 @@ whose dimensions may not be fully initialized by the time this is run."
|
|||
(or (and (featurep! :ui doom-modeline)
|
||||
(doom-modeline 'project))
|
||||
mode-line-format)))
|
||||
(let ((old-pwd (or dir default-directory)))
|
||||
(with-current-buffer (doom-fallback-buffer)
|
||||
(let ((+doom-dashboard--width 80)
|
||||
(old-pwd (or dir default-directory))
|
||||
(fallback-buffer (doom-fallback-buffer)))
|
||||
(dolist (win (get-buffer-window-list fallback-buffer nil t))
|
||||
(set-window-fringes win 0 0)
|
||||
(set-window-margins
|
||||
win (max 0 (/ (- (window-total-width win) +doom-dashboard--width) 2))))
|
||||
(with-current-buffer fallback-buffer
|
||||
(with-silent-modifications
|
||||
(unless (eq major-mode '+doom-dashboard-mode)
|
||||
(+doom-dashboard-mode))
|
||||
(erase-buffer)
|
||||
(setq default-directory old-pwd)
|
||||
(let ((+doom-dashboard--width (window-width))
|
||||
(+doom-dashboard--height (window-height)))
|
||||
(let ((+doom-dashboard--height (window-height)))
|
||||
(insert (make-string (max 0 (- (truncate (/ +doom-dashboard--height 2)) 16)) ?\n))
|
||||
(dolist (widget-name +doom-dashboard-widgets)
|
||||
(funcall (intern (format "doom-dashboard-widget--%s" widget-name)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue