changeset 32788:5ed618d6e94c

(tool-bar-add-item-from-menu) (tool-bar-add-item): Set foreground and background for XBM icons.
author Dave Love <fx@gnu.org>
date Mon, 23 Oct 2000 18:00:51 +0000
parents 6660ed022330
children d45445d41618
files lisp/toolbar/tool-bar.el
diffstat 1 files changed, 31 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/toolbar/tool-bar.el	Mon Oct 23 17:51:33 2000 +0000
+++ b/lisp/toolbar/tool-bar.el	Mon Oct 23 18:00:51 2000 +0000
@@ -90,14 +90,24 @@
 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
+  (let* ((fg (face-foreground 'tool-bar))
+	 (bg (face-background 'tool-bar))
+	 (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")))))))
+		     `((:type xpm :file ,(concat icon ".xpm"))
+		       (:type pbm :file ,(concat icon ".pbm")
+		        :background ,bg
+		        :foreground ,fg)
+		       (:type xbm :file ,(concat icon ".xbm")
+		        :background ,bg
+		        :foreground ,fg))
+		   `((:type pbm :file ,(concat icon ".pbm")
+		      :background ,bg
+		      :foreground ,fg)
+		     (:type xbm :file ,(concat icon ".xbm")
+		      :background ,bg
+		      :foreground ,fg)
+		     (:type xpm :file ,(concat icon ".xpm")))))))
     (when image
       (unless (image-mask-p image)
 	(setq image (append image '(:mask heuristic))))
@@ -120,13 +130,23 @@
     (setq map global-map))
   (let* ((menu-bar-map (lookup-key map [menu-bar]))
 	 (keys (where-is-internal command menu-bar-map))
+	 (fg (face-foreground 'tool-bar))
+	 (bg (face-background 'tool-bar))
 	 (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 pbm :file ,(concat icon ".pbm")
+		        :background ,bg
+		        :foreground ,fg)
+		       (:type xbm :file ,(concat icon ".xbm")
+		        :background ,bg
+		        :foreground ,fg))
+		   `((:type pbm :file ,(concat icon ".pbm")
+		      :background ,bg
+		      :foreground ,fg)
+		     (:type xbm :file ,(concat icon ".xbm")
+		      :background ,bg
+		      :foreground ,fg)
 		     (:type xpm :file ,(concat icon ".xpm"))))))
 	 submap key)
     (when image