aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/toolbar
diff options
context:
space:
mode:
authorGerd Moellmann <[email protected]>2000-11-29 19:21:47 +0000
committerGerd Moellmann <[email protected]>2000-11-29 19:21:47 +0000
commit3fae165ccb06ba4e0cfb74863f86f1b923507c42 (patch)
tree755dc65f6702245170e7c172fca84759a8571c11 /lisp/toolbar
parente3fa42c299bab0cb846c2b8b264390ae6983ed89 (diff)
(tool-bar-add-item-from-menu): Use
face-attribute instead of face-foreground and face-background. (tool-bar-add-item): Likewise, and handle unspecified colors.
Diffstat (limited to 'lisp/toolbar')
-rw-r--r--lisp/toolbar/tool-bar.el41
1 files changed, 18 insertions, 23 deletions
diff --git a/lisp/toolbar/tool-bar.el b/lisp/toolbar/tool-bar.el
index 901eabc090..4cfff846f8 100644
--- a/lisp/toolbar/tool-bar.el
+++ b/lisp/toolbar/tool-bar.el
@@ -89,24 +89,22 @@ function will try to use first ICON.xpm, ICON.pbm then ICON.xbm using
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* ((fg (face-foreground 'tool-bar))
- (bg (face-background 'tool-bar))
+ (let* ((fg (face-attribute 'tool-bar :foreground))
+ (bg (face-attribute 'tool-bar :background))
+ (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))
+ (if (eq bg 'unspecified) nil (list :background bg))))
(image (find-image
(if (display-color-p)
- `((: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")))))))
+ (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")))))))
(when image
(unless (image-mask-p image)
(setq image (append image '(:mask heuristic))))
@@ -129,13 +127,10 @@ function."
(setq map global-map))
(let* ((menu-bar-map (lookup-key map [menu-bar]))
(keys (where-is-internal command menu-bar-map))
- (fg (if (eq (face-foreground 'tool-bar) 'unspecified)
- nil
- (list :foreground (face-foreground 'tool-bar))))
- (bg (if (eq (face-background 'tool-bar) 'unspecified)
- nil
- (list :background (face-background 'tool-bar))))
- (colors (nconc fg bg))
+ (fg (face-attribute 'tool-bar :foreground))
+ (bg (face-attribute 'tool-bar :background))
+ (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))
+ (if (eq bg 'unspecified) nil (list :background bg))))
(spec (if (display-color-p)
(list (list :type 'xpm :file (concat icon ".xpm"))
(append (list :type 'pbm :file (concat icon ".pbm"))