aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-10-10 09:31:04 +0000
committerDave Love2000-10-10 09:31:04 +0000
commit34e86ea33bf07f390b06b9503f436e548417959e (patch)
tree4ccb90cbf8732d605904bb59464e67193dbb5918
parent862a7e281e2a3eaae9f527b8d361d33bff7bc0dd (diff)
downloademacs-34e86ea33bf07f390b06b9503f436e548417959e.tar.gz
emacs-34e86ea33bf07f390b06b9503f436e548417959e.zip
(tool-bar-add-item)
(tool-bar-add-item-from-menu): Don't favour XPM icons on mono display.
-rw-r--r--lisp/toolbar/tool-bar.el22
1 files changed, 16 insertions, 6 deletions
diff --git a/lisp/toolbar/tool-bar.el b/lisp/toolbar/tool-bar.el
index c1d9f6ab6d4..4cbad617e6f 100644
--- a/lisp/toolbar/tool-bar.el
+++ b/lisp/toolbar/tool-bar.el
@@ -90,9 +90,14 @@ function will try to use first ICON.xpm, ICON.pbm then ICON.xbm using
90Keybindings are made in the map `tool-bar-map'. To define items in 90Keybindings are made in the map `tool-bar-map'. To define items in
91some local map, bind `tool-bar-map' with `let' around calls of this 91some local map, bind `tool-bar-map' with `let' around calls of this
92function." 92function."
93 (let ((image (find-image `((:type xpm :file ,(concat icon ".xpm")) 93 (let ((image (find-image
94 (:type pbm :file ,(concat icon ".pbm")) 94 (if (display-color-p)
95 (:type xbm :file ,(concat icon ".xbm")))))) 95 `((:type xpm :file ,(concat icon ".xpm"))
96 (:type pbm :file ,(concat icon ".pbm"))
97 (:type xbm :file ,(concat icon ".xbm")))
98 `((:type pbm :file ,(concat icon ".pbm"))
99 (:type xbm :file ,(concat icon ".xbm"))
100 (:type xpm :file ,(concat icon ".xpm")))))))
96 (when image 101 (when image
97 (unless (image-mask-p image) 102 (unless (image-mask-p image)
98 (setq image (append image '(:mask heuristic)))) 103 (setq image (append image '(:mask heuristic))))
@@ -115,9 +120,14 @@ function."
115 (setq map global-map)) 120 (setq map global-map))
116 (let* ((menu-bar-map (lookup-key map [menu-bar])) 121 (let* ((menu-bar-map (lookup-key map [menu-bar]))
117 (keys (where-is-internal command menu-bar-map)) 122 (keys (where-is-internal command menu-bar-map))
118 (image (find-image `((:type xpm :file ,(concat icon ".xpm")) 123 (image (find-image
119 (:type pbm :file ,(concat icon ".pbm")) 124 (if (display-color-p)
120 (:type xbm :file ,(concat icon ".xbm"))))) 125 `((:type xpm :file ,(concat icon ".xpm"))
126 (:type pbm :file ,(concat icon ".pbm"))
127 (:type xbm :file ,(concat icon ".xbm")))
128 `((:type pbm :file ,(concat icon ".pbm"))
129 (:type xbm :file ,(concat icon ".xbm"))
130 (:type xpm :file ,(concat icon ".xpm"))))))
121 submap key) 131 submap key)
122 (when image 132 (when image
123 ;; We'll pick up the last valid entry in the list of keys if 133 ;; We'll pick up the last valid entry in the list of keys if