Skip to content

Commit

Permalink
Fixing bug: Dired icon on macOS doesn't highlight.
Browse files Browse the repository at this point in the history
Adding margins around all buttons so images with no transparent pixels
still highlight.
  • Loading branch information
chaosemer committed Nov 23, 2023
1 parent 43b44ac commit 9bf538f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion window-tool-bar.el
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ This is for when you want more customizations than
`window-tool-bar-mode' provides. Commonly added to the variable
`tab-line-format', `header-line-format', or `mode-line-format'"
(let ((toolbar-menu (cdr (keymap-global-lookup "<tool-bar>"))))
(mapconcat #'window-tool-bar--keymap-entry-to-string toolbar-menu " ")))
(mapconcat #'window-tool-bar--keymap-entry-to-string toolbar-menu
;; Without spaces between the text, hovering highlights
;; all adjacent buttons.
(propertize " " 'invisible t))))

(defun window-tool-bar--keymap-entry-to-string (menu-item)
"Convert MENU-ITEM into a (propertized) string representation.
Expand All @@ -90,6 +93,7 @@ MENU-ITEM: Menu item to convert. See info node (elisp)Tool Bar."
(when-let ((spec (plist-get menu-item :image)))
(setq str (propertize str
'display (append spec
'(:margin 2)
(unless enabled '(:conversion disabled))))))
(when-let ((spec (plist-get menu-item :help)))
(setq str (propertize str
Expand Down

0 comments on commit 9bf538f

Please sign in to comment.