changeset 32358:52dcf5ad6176

(tool-bar-add-item) (tool-bar-add-item-from-menu): Don't favour XPM icons on mono display.
author Dave Love <fx@gnu.org>
date Tue, 10 Oct 2000 09:31:04 +0000
parents e8a33eb0e2b4
children 93e229052aa9
files lisp/toolbar/tool-bar.el
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/toolbar/tool-bar.el	Tue Oct 10 02:48:40 2000 +0000
+++ b/lisp/toolbar/tool-bar.el	Tue Oct 10 09:31:04 2000 +0000
@@ -90,9 +90,14 @@
 Keybindings are made in the map `tool-bar-map'.  To define items in
 some local map, bind `tool-bar-map' with `let' around calls of this
 function."
-  (let ((image (find-image `((:type xpm :file ,(concat icon ".xpm"))
-			     (:type pbm :file ,(concat icon ".pbm"))
-			     (:type xbm :file ,(concat icon ".xbm"))))))
+  (let ((image (find-image
+		(if (display-color-p)
+		    `((:type xpm :file ,(concat icon ".xpm"))
+		      (:type pbm :file ,(concat icon ".pbm"))
+		      (:type xbm :file ,(concat icon ".xbm")))
+		  `((:type pbm :file ,(concat icon ".pbm"))
+		    (:type xbm :file ,(concat icon ".xbm"))
+		    (:type xpm :file ,(concat icon ".xpm")))))))
     (when image
       (unless (image-mask-p image)
 	(setq image (append image '(:mask heuristic))))
@@ -115,9 +120,14 @@
     (setq map global-map))
   (let* ((menu-bar-map (lookup-key map [menu-bar]))
 	 (keys (where-is-internal command menu-bar-map))
-	 (image (find-image `((:type xpm :file ,(concat icon ".xpm"))
-			      (:type pbm :file ,(concat icon ".pbm"))
-			      (:type xbm :file ,(concat icon ".xbm")))))
+	 (image (find-image
+		 (if (display-color-p)
+		     `((:type xpm :file ,(concat icon ".xpm"))
+		       (:type pbm :file ,(concat icon ".pbm"))
+		       (:type xbm :file ,(concat icon ".xbm")))
+		   `((:type pbm :file ,(concat icon ".pbm"))
+		     (:type xbm :file ,(concat icon ".xbm"))
+		     (:type xpm :file ,(concat icon ".xpm"))))))
 	 submap key)
     (when image
       ;; We'll pick up the last valid entry in the list of keys if