comparison lisp/toolbar/tool-bar.el @ 33895:3683396305bc

(tool-bar-add-item-from-menu): Handle case that foreground and/or background colors of the face `tool-bar' are unspecified.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 27 Nov 2000 11:28:24 +0000
parents b470e0e05721
children 423ccdfa2db5
comparison
equal deleted inserted replaced
33894:bec74894e41f 33895:3683396305bc
127 function." 127 function."
128 (unless map 128 (unless map
129 (setq map global-map)) 129 (setq map global-map))
130 (let* ((menu-bar-map (lookup-key map [menu-bar])) 130 (let* ((menu-bar-map (lookup-key map [menu-bar]))
131 (keys (where-is-internal command menu-bar-map)) 131 (keys (where-is-internal command menu-bar-map))
132 (fg (face-foreground 'tool-bar)) 132 (fg (if (eq (face-foreground 'tool-bar) 'unspecified)
133 (bg (face-background 'tool-bar)) 133 nil
134 (image (find-image 134 (list :foreground (face-foreground 'tool-bar))))
135 (if (display-color-p) 135 (bg (if (eq (face-background 'tool-bar) 'unspecified)
136 `((:type xpm :file ,(concat icon ".xpm")) 136 nil
137 (:type pbm :file ,(concat icon ".pbm") 137 (list :background (face-background 'tool-bar))))
138 :background ,bg 138 (colors (nconc fg bg))
139 :foreground ,fg) 139 (spec (if (display-color-p)
140 (:type xbm :file ,(concat icon ".xbm") 140 (list (list :type 'xpm :file (concat icon ".xpm"))
141 :background ,bg 141 (append (list :type 'pbm :file (concat icon ".pbm"))
142 :foreground ,fg)) 142 colors)
143 `((:type pbm :file ,(concat icon ".pbm") 143 (append (list :type 'xbm :file (concat icon ".xbm"))
144 :background ,bg 144 colors))
145 :foreground ,fg) 145 (list (append (list :type 'pbm :file (concat icon ".pbm"))
146 (:type xbm :file ,(concat icon ".xbm") 146 colors)
147 :background ,bg 147 (append (list :type 'xbm :file (concat icon ".xbm"))
148 :foreground ,fg) 148 colors)
149 (:type xpm :file ,(concat icon ".xpm")))))) 149 (list :type 'xpm :file (concat icon ".xpm")))))
150 (image (find-image spec))
150 submap key) 151 submap key)
151 (when image 152 (when image
152 ;; We'll pick up the last valid entry in the list of keys if 153 ;; We'll pick up the last valid entry in the list of keys if
153 ;; there's more than one. 154 ;; there's more than one.
154 (dolist (k keys) 155 (dolist (k keys)