Bug 984078 - Use the same border style for all menu items. r=karlt
authorMartin Stransky <stransky@redhat.com>
Tue, 22 Apr 2014 13:59:39 -0700
changeset 180047 4e1aafbda8e4fd73909d756e53f5bd518f018584
parent 180046 5805f3907c9ac9fb239acc4e89e6679f9abc06ab
child 180048 c2672cd82c959f0289b759a1fb63eb790ba3ed14
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerskarlt
bugs984078
milestone31.0a1
Bug 984078 - Use the same border style for all menu items. r=karlt
widget/gtk/gtk3drawing.c
--- a/widget/gtk/gtk3drawing.c
+++ b/widget/gtk/gtk3drawing.c
@@ -2802,30 +2802,34 @@ moz_gtk_get_widget_border(GtkThemeWidget
 
             return MOZ_GTK_SUCCESS;
         }
     case MOZ_GTK_MENUPOPUP:
         ensure_menu_popup_widget();
         w = gMenuPopupWidget;
         break;
     case MOZ_GTK_MENUITEM:
+    case MOZ_GTK_CHECKMENUITEM:
+    case MOZ_GTK_RADIOMENUITEM:
         {
-            ensure_menu_item_widget();
-            ensure_menu_bar_item_widget();
-            
-            *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gMenuItemWidget));
-            moz_gtk_add_style_padding(gtk_widget_get_style_context(gMenuItemWidget), 
+            if (widget == MOZ_GTK_MENUITEM) {
+                ensure_menu_item_widget();
+                ensure_menu_bar_item_widget();
+                w = gMenuItemWidget;
+            }
+            else {
+                ensure_check_menu_item_widget();
+                w = gCheckMenuItemWidget;
+            }
+
+            *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(w));
+            moz_gtk_add_style_padding(gtk_widget_get_style_context(w),
                                       left, top, right, bottom);
             return MOZ_GTK_SUCCESS;
         }
-    case MOZ_GTK_CHECKMENUITEM:
-    case MOZ_GTK_RADIOMENUITEM:
-        ensure_check_menu_item_widget();
-        w = gCheckMenuItemWidget;
-        break;
     case MOZ_GTK_TAB:
         ensure_tab_widget();
         w = gTabWidget;
         break;
     /* These widgets have no borders, since they are not containers. */
     case MOZ_GTK_SPLITTER_HORIZONTAL:
     case MOZ_GTK_SPLITTER_VERTICAL:
     case MOZ_GTK_CHECKBUTTON: