mirror of
https://github.com/ryuslash/mode-icons.git
synced 2024-11-21 17:40:30 +01:00
Use a more accurate way to determine height for icons
Instead of trying to use the default text height of the current window (or some other window), ask for the text height of the mode-line face. This should fix the height when a theme changes the height of the mode-line text to a different height than the default text height.
This commit is contained in:
parent
9eac12fe51
commit
e29ab28992
1 changed files with 5 additions and 5 deletions
|
@ -507,12 +507,12 @@ ACTIVE tells if current window is active."
|
|||
:group 'mode-icons)
|
||||
|
||||
(defun mode-icons-line-height (&optional window)
|
||||
"Gets the height in pixels of WINDOW's mode-line, if accessible.
|
||||
This uses `window-mode-line-height' on emacs 24.4+. Otherwise it assumes 16.
|
||||
|
||||
This function also adjusts the line height by `mode-icons-line-height-adjust'."
|
||||
"Gets the height in pixels of WINDOW's mode-line font.
|
||||
This function also adjusts the line height by
|
||||
`mode-icons-line-height-adjust'. If WINDOW is nil, it defaults to
|
||||
the current window"
|
||||
(+ mode-icons-line-height-adjust
|
||||
(or (and (fboundp 'window-mode-line-height) (window-default-font-height window)) 16)))
|
||||
(aref (font-info (face-font 'mode-line) (window-frame window)) 3)))
|
||||
|
||||
(defun mode-icons-get-icon-display (icon type &optional face active)
|
||||
"Get the value for the display property of ICON having TYPE.
|
||||
|
|
Loading…
Reference in a new issue