# HG changeset patch # User Jan Dj¸«£rv # Date 1086716872 0 # Node ID 49f0c8a3942a6a7353cd4c495609a31629781d41 # Parent 531dc4a2136baaf82b10bbe4082350af3cf1a171 * 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. diff -r 531dc4a2136b -r 49f0c8a3942a lisp/toolbar/tool-bar.el --- a/lisp/toolbar/tool-bar.el Tue Jun 08 17:46:12 2004 +0000 +++ b/lisp/toolbar/tool-bar.el Tue Jun 08 17:47:52 2004 +0000 @@ -118,18 +118,17 @@ (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 @@ (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)