]> git.eshelyaron.com Git - emacs.git/commitdiff
Center Emacs logo above text on the splash screen
authorStefan Kangas <stefan@marxist.se>
Wed, 8 Sep 2021 01:57:11 +0000 (03:57 +0200)
committerStefan Kangas <stefan@marxist.se>
Wed, 8 Sep 2021 02:18:44 +0000 (04:18 +0200)
* lisp/startup.el (fancy-splash-head): Center Emacs logo above
text on the splash and about screen.

lisp/startup.el

index 58030ca06af8e0d85300c6b87272c4c020bef8a4..505d7b83f48668a88684a93797da044c99340b6a 100644 (file)
@@ -1788,9 +1788,19 @@ a face or button specification."
         (window-width (window-width)))
     (when img
       (when (> window-width image-width)
-       ;; Center the image in the window.
-       (insert (propertize " " 'display
-                           `(space :align-to (+ center (-0.5 . ,img)))))
+        ;; Center the image above text.
+        ;;  NB. The logo used to be centered in the window, which made
+        ;;      it align poorly with the non-centered text on large
+        ;;      displays.  Arguably it would be better to center both
+        ;;      text and image, but this will do for now.  -- SK
+        (let ((text-width 80)
+              ;; The below value chosen to avoid splash screen being
+              ;; visually unbalanced.  This needs to be eye-balled.
+              (adjust-left 3))
+          (insert (propertize " " 'display
+                              `(space :align-to (+ ,(- (/ text-width 2)
+                                                       adjust-left)
+                                                   (-0.5 . ,img))))))
 
        ;; Change the color of the XPM version of the splash image
        ;; so that it is visible with a dark frame background.