aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-09-15 21:01:14 +0000
committerGerd Moellmann2000-09-15 21:01:14 +0000
commit37e4e4828628dad925a28d4f6eba50f95487649d (patch)
tree35c1c1ea1c52df68ca187abe90bbfbfae63d7d7b
parent2b26ac776d715d99a2215dfe5df4009b18076a4a (diff)
downloademacs-37e4e4828628dad925a28d4f6eba50f95487649d.tar.gz
emacs-37e4e4828628dad925a28d4f6eba50f95487649d.zip
(build_desired_tool_bar_string): For a toolbar item in
disabled state, don't apply an image transformation algorithm if the user specified an image for the disabled state. Use `:algorthm disabled' for creating a disabled item's image if the user hasn't specified an image.
-rw-r--r--src/xdisp.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 9d9815e8e94..816ea6debf7 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6846,7 +6846,7 @@ build_desired_tool_bar_string (f)
6846 6846
6847 int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P)); 6847 int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P));
6848 int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)); 6848 int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P));
6849 int margin, relief; 6849 int margin, relief, idx;
6850 extern Lisp_Object QCrelief, QCmargin, QCalgorithm, Qimage; 6850 extern Lisp_Object QCrelief, QCmargin, QCalgorithm, Qimage;
6851 extern Lisp_Object Qlaplace; 6851 extern Lisp_Object Qlaplace;
6852 6852
@@ -6855,8 +6855,6 @@ build_desired_tool_bar_string (f)
6855 image = PROP (TOOL_BAR_ITEM_IMAGES); 6855 image = PROP (TOOL_BAR_ITEM_IMAGES);
6856 if (VECTORP (image)) 6856 if (VECTORP (image))
6857 { 6857 {
6858 enum tool_bar_item_image idx;
6859
6860 if (enabled_p) 6858 if (enabled_p)
6861 idx = (selected_p 6859 idx = (selected_p
6862 ? TOOL_BAR_IMAGE_ENABLED_SELECTED 6860 ? TOOL_BAR_IMAGE_ENABLED_SELECTED
@@ -6866,9 +6864,11 @@ build_desired_tool_bar_string (f)
6866 ? TOOL_BAR_IMAGE_DISABLED_SELECTED 6864 ? TOOL_BAR_IMAGE_DISABLED_SELECTED
6867 : TOOL_BAR_IMAGE_DISABLED_DESELECTED); 6865 : TOOL_BAR_IMAGE_DISABLED_DESELECTED);
6868 6866
6869 xassert (XVECTOR (image)->size >= idx); 6867 xassert (ASIZE (image) >= idx);
6870 image = XVECTOR (image)->contents[idx]; 6868 image = AREF (image, idx);
6871 } 6869 }
6870 else
6871 idx = -1;
6872 6872
6873 /* Ignore invalid image specifications. */ 6873 /* Ignore invalid image specifications. */
6874 if (!valid_image_p (image)) 6874 if (!valid_image_p (image))
@@ -6907,10 +6907,11 @@ build_desired_tool_bar_string (f)
6907 if (margin) 6907 if (margin)
6908 plist = Fplist_put (plist, QCmargin, make_number (margin)); 6908 plist = Fplist_put (plist, QCmargin, make_number (margin));
6909 6909
6910 /* If button is not enabled, make the image appear disabled by 6910 /* If button is not enabled, and we don't have special images
6911 for the disabled state, make the image appear disabled by
6911 applying an appropriate algorithm to it. */ 6912 applying an appropriate algorithm to it. */
6912 if (!enabled_p) 6913 if (!enabled_p && idx < 0)
6913 plist = Fplist_put (plist, QCalgorithm, Qlaplace); 6914 plist = Fplist_put (plist, QCalgorithm, Qdisabled);
6914 6915
6915 /* Put a `display' text property on the string for the image to 6916 /* Put a `display' text property on the string for the image to
6916 display. Put a `menu-item' property on the string that gives 6917 display. Put a `menu-item' property on the string that gives