From 7f8cf4564df13e8f8aab75928cb9a238b2bd0539 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Jul 2015 22:07:27 -0400 Subject: [PATCH] core: home buffer, more robust centering of stuff --- core/core-spacemacs-buffer.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/core-spacemacs-buffer.el b/core/core-spacemacs-buffer.el index 49445ae8f..fe859b850 100644 --- a/core/core-spacemacs-buffer.el +++ b/core/core-spacemacs-buffer.el @@ -107,7 +107,8 @@ If ALL is non-nil then truly all banners can be selected." (defun spacemacs-buffer//insert-image-banner (banner) "Display an image banner." (when (file-exists-p banner) - (let* ((spec (create-image banner)) + (let* ((title "[S P A C E M A C S]") + (spec (create-image banner)) (size (image-size spec)) (width (car size)) (left-margin (floor (- spacemacs-buffer--banner-length width) 2))) @@ -116,7 +117,9 @@ If ALL is non-nil then truly all banners can be selected." (insert (make-string (- left-margin 1) ?\ )) (insert-image spec) (insert "\n\n") - (insert " [S P A C E M A C S]\n\n")))) + (insert (make-string (+ left-margin + (floor (/ (- width (length title)) 2))) ?\ )) + (insert (format "%s\n\n" title))))) (defun spacemacs-buffer//inject-version () "Inject the current version of spacemacs in the first line of the @@ -333,7 +336,7 @@ The vertical spacing is always one line." (delete-char -1)) (let* ((hpadding (or hpadding 1)) (fill-column (if width - (- width hpadding) + (- width (+ 2 (* 2 hpadding))) fill-column)) (sentence-end-double-space nil) (caption-len (length caption))) @@ -396,7 +399,7 @@ HPADDING is the horizontal spacing betwee the content line and the frame border. (defun spacemacs-buffer//insert-buttons () (goto-char (point-max)) - (insert " ") + (insert " ") (spacemacs//insert--shortcut "m" "[?]" t) (widget-create 'url-link :tag (propertize "?" 'face 'font-lock-doc-face) @@ -444,7 +447,7 @@ HPADDING is the horizontal spacing betwee the content line and the frame border. :follow-link "\C-m" (propertize "Rollback" 'face 'font-lock-keyword-face)) (insert "\n") - (insert " ") + (insert " ") (widget-create 'push-button :tag (propertize "Release Notes" 'face 'font-lock-preprocessor-face) :help-echo "Hide or show the Changelog"