bug 1287036 draw separator menuitem background and frame behind separator in menu r?stransky draft
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 17 Nov 2016 11:04:13 +1300
changeset 440183 a3bfb282cfc5b1514cdaf1d63b674422102f6dcd
parent 440181 9d5d434bad804ee2b0a8070ca070196f2bf0a895
child 440196 f3155dbec2aba7f5910844598f8c2f21836bd932
child 440198 8b0c9f5e59fd416f8a8960acc49edbec7c3b3c84
push id36165
push userktomlinson@mozilla.com
push dateThu, 17 Nov 2016 03:35:07 +0000
reviewersstransky
bugs1287036
milestone53.0a1
bug 1287036 draw separator menuitem background and frame behind separator in menu r?stransky as does gtk_menu_item_draw(). MozReview-Commit-ID: DgYVFklmTO2
widget/gtk/gtk3drawing.cpp
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -31,16 +31,20 @@ static gboolean is_initialized;
 
 #if !GTK_CHECK_VERSION(3,14,0)
 #define GTK_STATE_FLAG_CHECKED (1 << 11)
 #endif
 
 static gint
 moz_gtk_get_tab_thickness(GtkStyleContext *style);
 
+static gint
+moz_gtk_menu_item_paint(WidgetNodeType widget, cairo_t *cr, GdkRectangle* rect,
+                        GtkWidgetState* state, GtkTextDirection direction);
+
 static GtkStateFlags
 GetStateFlagsFromGtkWidgetState(GtkWidgetState* state)
 {
     GtkStateFlags stateFlags = GTK_STATE_FLAG_NORMAL;
 
     if (state->disabled)
         stateFlags = GTK_STATE_FLAG_INSENSITIVE;
     else {    
@@ -1761,16 +1765,20 @@ moz_gtk_menu_popup_paint(cairo_t *cr, Gd
     return MOZ_GTK_SUCCESS;
 }
 
 // See gtk_menu_item_draw() for reference.
 static gint
 moz_gtk_menu_separator_paint(cairo_t *cr, GdkRectangle* rect,
                              GtkTextDirection direction)
 {
+    GtkWidgetState defaultState = { 0 };
+    moz_gtk_menu_item_paint(MOZ_GTK_MENUSEPARATOR, cr, rect,
+                            &defaultState, direction);
+
     GtkStyleContext* style;
     gboolean wide_separators;
     gint separator_height;
     gint x, y, w;
     GtkBorder padding;
 
     style = ClaimStyleContext(MOZ_GTK_MENUSEPARATOR, direction);
     gtk_style_context_get_padding(style, GTK_STATE_FLAG_NORMAL, &padding);