From e9e5760f372cefa7af2b6c045b92537f378076dd Mon Sep 17 00:00:00 2001 From: Soeren Sandmann Date: Sat, 20 Apr 2002 19:21:59 +0000 Subject: [PATCH] add "selected_shadow_type" style property Sat Apr 20 21:15:11 2002 Soeren Sandmann * gtk/gtkmenuitem.c: add "selected_shadow_type" style property --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-2 | 4 ++++ ChangeLog.pre-2-4 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ gtk/gtkmenuitem.c | 30 ++++++++++++++++++++++-------- 7 files changed, 46 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c98dfd896..80caac6796 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Apr 20 21:15:11 2002 Soeren Sandmann + + * gtk/gtkmenuitem.c: add "selected_shadow_type" style property + Sat Apr 20 12:07:14 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_modify_color_component): Accept diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 2c98dfd896..80caac6796 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +Sat Apr 20 21:15:11 2002 Soeren Sandmann + + * gtk/gtkmenuitem.c: add "selected_shadow_type" style property + Sat Apr 20 12:07:14 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_modify_color_component): Accept diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 2c98dfd896..80caac6796 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,7 @@ +Sat Apr 20 21:15:11 2002 Soeren Sandmann + + * gtk/gtkmenuitem.c: add "selected_shadow_type" style property + Sat Apr 20 12:07:14 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_modify_color_component): Accept diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 2c98dfd896..80caac6796 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,7 @@ +Sat Apr 20 21:15:11 2002 Soeren Sandmann + + * gtk/gtkmenuitem.c: add "selected_shadow_type" style property + Sat Apr 20 12:07:14 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_modify_color_component): Accept diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 2c98dfd896..80caac6796 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +Sat Apr 20 21:15:11 2002 Soeren Sandmann + + * gtk/gtkmenuitem.c: add "selected_shadow_type" style property + Sat Apr 20 12:07:14 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_modify_color_component): Accept diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 2c98dfd896..80caac6796 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +Sat Apr 20 21:15:11 2002 Soeren Sandmann + + * gtk/gtkmenuitem.c: add "selected_shadow_type" style property + Sat Apr 20 12:07:14 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_modify_color_component): Accept diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index 194c92f24b..552c0f0498 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -202,6 +202,15 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass) _gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); + + gtk_widget_class_install_style_property_parser (widget_class, + g_param_spec_enum ("selected_shadow_type", + "Selected Shadow Type", + "Shadow type when item is selected", + GTK_TYPE_SHADOW_TYPE, + GTK_SHADOW_OUT, + G_PARAM_READABLE), + gtk_rc_property_parse_enum); } static void @@ -587,7 +596,7 @@ gtk_menu_item_paint (GtkWidget *widget, { GtkMenuItem *menu_item; GtkStateType state_type; - GtkShadowType shadow_type; + GtkShadowType shadow_type, selected_shadow_type; gint width, height; gint x, y; gint border_width = GTK_CONTAINER (widget)->border_width; @@ -605,13 +614,18 @@ gtk_menu_item_paint (GtkWidget *widget, if ((state_type == GTK_STATE_PRELIGHT) && (GTK_BIN (menu_item)->child)) - gtk_paint_box (widget->style, - widget->window, - GTK_STATE_PRELIGHT, - GTK_SHADOW_OUT, - area, widget, "menuitem", - x, y, width, height); - + { + gtk_widget_style_get (widget, + "selected_shadow_type", &selected_shadow_type, + NULL); + gtk_paint_box (widget->style, + widget->window, + GTK_STATE_PRELIGHT, + selected_shadow_type, + area, widget, "menuitem", + x, y, width, height); + } + if (menu_item->submenu && menu_item->show_submenu_indicator) { GtkRequisition child_requisition;