aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJan Djärv <[email protected]>2004-06-08 17:47:52 +0000
committerJan Djärv <[email protected]>2004-06-08 17:47:52 +0000
commitcf5458238d84282565904b7e77f7aa77714ba0dc (patch)
tree9917054ad9547915ac4ac77df2459ee2a5cb5f5f /lisp
parent2976ca56afb0785cbc4c60b7c20b64b43e0654da (diff)
* 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.
Diffstat (limited to 'lisp')
-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 6b890e5078..7ded78b80e 100644
--- a/lisp/toolbar/tool-bar.el
+++ b/lisp/toolbar/tool-bar.el
@@ -118,18 +118,17 @@ ICON.xbm, using `find-image'."
(bg (face-attribute 'tool-bar :background))
(colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))
(if (eq bg 'unspecified) nil (list :background bg))))
+ (xpm-spec (list :type 'xpm :file (concat icon ".xpm")))
+ (xpm-lo-spec (if (> (display-color-cells) 256)
+ nil
+ (list :type 'xpm :file (concat icon ".xpm"))))
+ (pbm-spec (append (list :type 'pbm :file (concat icon ".pbm")) colors))
+ (xbm-spec (append (list :type 'xbm :file (concat icon ".xbm")) colors))
(image (find-image
(if (display-color-p)
- (list (list :type 'xpm :file (concat icon ".xpm"))
- (append (list :type 'pbm :file (concat icon ".pbm"))
- colors)
- (append (list :type 'xbm :file (concat icon ".xbm"))
- colors))
- (list (append (list :type 'pbm :file (concat icon ".pbm"))
- colors)
- (append (list :type 'xbm :file (concat icon ".xbm"))
- colors)
- (list :type 'xpm :file (concat icon ".xpm")))))))
+ (list xpm-lo-spec xpm-spec pbm-spec xbm-spec)
+ (list pbm-spec xbm-spec xpm-lo-spec xpm-spec)))))
+
(when (and (display-images-p) image)
(unless (image-mask-p image)
(setq image (append image '(:mask heuristic))))
@@ -170,17 +169,15 @@ MAP must contain appropriate binding for `[menu-bar]' which holds a keymap."
(bg (face-attribute 'tool-bar :background))
(colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))
(if (eq bg 'unspecified) nil (list :background bg))))
+ (xpm-spec (list :type 'xpm :file (concat icon ".xpm")))
+ (xpm-lo-spec (if (> (display-color-cells) 256)
+ nil
+ (list :type 'xpm :file (concat icon "-locol.xpm"))))
+ (pbm-spec (append (list :type 'pbm :file (concat icon ".pbm")) colors))
+ (xbm-spec (append (list :type 'xbm :file (concat icon ".xbm")) colors))
(spec (if (display-color-p)
- (list (list :type 'xpm :file (concat icon ".xpm"))
- (append (list :type 'pbm :file (concat icon ".pbm"))
- colors)
- (append (list :type 'xbm :file (concat icon ".xbm"))
- colors))
- (list (append (list :type 'pbm :file (concat icon ".pbm"))
- colors)
- (append (list :type 'xbm :file (concat icon ".xbm"))
- colors)
- (list :type 'xpm :file (concat icon ".xpm")))))
+ (list xpm-lo-spec xpm-spec pbm-spec xbm-spec)
+ (list pbm-spec xbm-spec xpm-lo-spec xpm-spec)))
(image (find-image spec))
submap key)
(when (and (display-images-p) image)