diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-12-04 19:45:30 +0100 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-12-05 12:35:12 +0100 |
commit | d736e8baf9cbda017f738b5c5dcbf71f0713b4bc (patch) | |
tree | ff3a80df9076200a570daa9cc7d567042eab7951 /gtk/gtkmenuitem.c | |
parent | 9bfe7525cea3f60ed884d33872c1542c7b45f026 (diff) | |
download | gtk+-d736e8baf9cbda017f738b5c5dcbf71f0713b4bc.tar.gz |
GtkMenuItem: only set 'separator' class on the separator line
To make the separator line distinguishable from the widget's normal
border from css.
https://bugzilla.gnome.org/show_bug.cgi?id=719861
Diffstat (limited to 'gtk/gtkmenuitem.c')
-rw-r--r-- | gtk/gtkmenuitem.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index e6430db1e5..61843f7855 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -987,6 +987,9 @@ gtk_menu_item_real_get_height (GtkWidget *widget, gboolean wide_separators; gint separator_height; + gtk_style_context_save (context); + gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR); + gtk_widget_style_get (widget, "wide-separators", &wide_separators, "separator-height", &separator_height, @@ -1007,6 +1010,8 @@ gtk_menu_item_real_get_height (GtkWidget *widget, if (nat_height % 2 == 0) nat_height += 1; } + + gtk_style_context_restore (context); } accel_width = 0; @@ -1696,6 +1701,9 @@ gtk_menu_item_draw (GtkWidget *widget, gboolean wide_separators; gint separator_height; + gtk_style_context_save (context); + gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR); + gtk_widget_style_get (widget, "wide-separators", &wide_separators, "separator-height", &separator_height, @@ -1712,6 +1720,8 @@ gtk_menu_item_draw (GtkWidget *widget, y + padding.top, x + w - padding.right - 1, y + padding.top); + + gtk_style_context_restore (context); } GTK_WIDGET_CLASS (gtk_menu_item_parent_class)->draw (widget, cr); |