rougier / nano-modeline

GNU Emacs / N Λ N O Modeline
GNU General Public License v3.0
170 stars 29 forks source link

[Question] Adding a newline between header-line and the buffer text. #41

Closed FieryCod closed 1 year ago

FieryCod commented 2 years ago

Thank you for this visually appealing package. Would you please be so kind and let me know whether it's possible to add an extra margin between the header-line and the buffer text? Thanks in advance and all the best!

rougier commented 2 years ago

If you have a background color for the header line, I don't think is is possible. Else, you can exploit the raise display properties.

artelse commented 2 years ago

image Am having the same problem, the top line needs more room to breath. Edit: seems Emacs has no way to set a margin on top/bottom, just fringe left/right. Wished we simply had css for these sorta things.

rougier commented 2 years ago

Maybe you can insert a (white) space in front of the prefix (RW) with a tiny font (like :height 10) and adds a display property with e.g. (raise -1.0). This basically tell Emacs the character is below the baseline and it should enlarge the whole header line:

(setq header-line-format
      (concat (propertize "#" 'display '(raise -1.5) 'face '(:foreground "white"))
          (propertize "Hello" 'display '(raise -0.75)
              'face '(:background "yellow"
                               :box (:line-width (0 . -5) :color "white" :style flat)
                               ))))