aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2004-06-08 17:47:52 +0000
committerJan Djärv2004-06-08 17:47:52 +0000
commitcf5458238d84282565904b7e77f7aa77714ba0dc (patch)
tree9917054ad9547915ac4ac77df2459ee2a5cb5f5f
parent2976ca56afb0785cbc4c60b7c20b64b43e0654da (diff)
downloademacs-cf5458238d84282565904b7e77f7aa77714ba0dc.tar.gz
emacs-cf5458238d84282565904b7e77f7aa77714ba0dc.zip
* toolbar/tool-bar.el (tool-bar-local-item)
(tool-bar-local-item-from-menu): Try to use icons with fewer colors if display-color-cells is 256 or less.
-rw-r--r--lisp/toolbar/tool-bar.el37
1 files changed, 17 insertions, 20 deletions
diff --git a/lisp/toolbar/tool-bar.el b/lisp/toolbar/tool-bar.el
index 6b890e5078f..7ded78b80e1 100644
--- a/lisp/toolbar/tool-bar.el
+++ b/lisp/toolbar/tool-bar.el
@@ -118,18 +118,17 @@ ICON.xbm, using `find-image'."
118 (bg (face-attribute 'tool-bar :background)) 118 (bg (face-attribute 'tool-bar :background))
119 (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg)) 119 (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))
120 (if (eq bg 'unspecified) nil (list :background bg)))) 120 (if (eq bg 'unspecified) nil (list :background bg))))
121 (xpm-spec (list :type 'xpm :file (concat icon ".xpm")))
122 (xpm-lo-spec (if (> (display-color-cells) 256)
123 nil
124 (list :type 'xpm :file (concat icon ".xpm"))))
125 (pbm-spec (append (list :type 'pbm :file (concat icon ".pbm")) colors))
126 (xbm-spec (append (list :type 'xbm :file (concat icon ".xbm")) colors))
121 (image (find-image 127 (image (find-image
122 (if (display-color-p) 128 (if (display-color-p)
123 (list (list :type 'xpm :file (concat icon ".xpm")) 129 (list xpm-lo-spec xpm-spec pbm-spec xbm-spec)
124 (append (list :type 'pbm :file (concat icon ".pbm")) 130 (list pbm-spec xbm-spec xpm-lo-spec xpm-spec)))))
125 colors) 131
126 (append (list :type 'xbm :file (concat icon ".xbm"))
127 colors))
128 (list (append (list :type 'pbm :file (concat icon ".pbm"))
129 colors)
130 (append (list :type 'xbm :file (concat icon ".xbm"))
131 colors)
132 (list :type 'xpm :file (concat icon ".xpm")))))))
133 (when (and (display-images-p) image) 132 (when (and (display-images-p) image)
134 (unless (image-mask-p image) 133 (unless (image-mask-p image)
135 (setq image (append image '(:mask heuristic)))) 134 (setq image (append image '(:mask heuristic))))
@@ -170,17 +169,15 @@ MAP must contain appropriate binding for `[menu-bar]' which holds a keymap."
170 (bg (face-attribute 'tool-bar :background)) 169 (bg (face-attribute 'tool-bar :background))
171 (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg)) 170 (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))
172 (if (eq bg 'unspecified) nil (list :background bg)))) 171 (if (eq bg 'unspecified) nil (list :background bg))))
172 (xpm-spec (list :type 'xpm :file (concat icon ".xpm")))
173 (xpm-lo-spec (if (> (display-color-cells) 256)
174 nil
175 (list :type 'xpm :file (concat icon "-locol.xpm"))))
176 (pbm-spec (append (list :type 'pbm :file (concat icon ".pbm")) colors))
177 (xbm-spec (append (list :type 'xbm :file (concat icon ".xbm")) colors))
173 (spec (if (display-color-p) 178 (spec (if (display-color-p)
174 (list (list :type 'xpm :file (concat icon ".xpm")) 179 (list xpm-lo-spec xpm-spec pbm-spec xbm-spec)
175 (append (list :type 'pbm :file (concat icon ".pbm")) 180 (list pbm-spec xbm-spec xpm-lo-spec xpm-spec)))
176 colors)
177 (append (list :type 'xbm :file (concat icon ".xbm"))
178 colors))
179 (list (append (list :type 'pbm :file (concat icon ".pbm"))
180 colors)
181 (append (list :type 'xbm :file (concat icon ".xbm"))
182 colors)
183 (list :type 'xpm :file (concat icon ".xpm")))))
184 (image (find-image spec)) 181 (image (find-image spec))
185 submap key) 182 submap key)
186 (when (and (display-images-p) image) 183 (when (and (display-images-p) image)