diff options
-rw-r--r-- | dashboard.el | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/dashboard.el b/dashboard.el index 4e1914e..1abc53d 100644 --- a/dashboard.el +++ b/dashboard.el @@ -42,13 +42,26 @@ If FORCE is non-nil, re-gerenate the dashboard buffer." (erase-buffer) (cond ((display-graphic-p) - (let ((image (create-image (expand-file-name "cat.png" user-emacs-directory)))) + (let* ((image + (create-image + (expand-file-name + "cat.png" + user-emacs-directory))) + (str (propertize + " " + 'display image + 'rear-nonsticky '(display))) + (str-width (string-pixel-width str))) (insert (make-string 3 10) - (center-string-in-width - (propertize " " 'display image 'rear-nonsticky '(display)) - (round (- (window-body-width) - (* (car (image-size image)) 1))))))) + (propertize + (string 32) + 'display + (list + 'space + :width + (list (floor (- (window-body-width nil t) str-width) 2)))) + str))) ((mapc (function (lambda (str) (insert |