Bug 1228281 - [GTK3] add padding to buttons. r=karlt
authorMartin Stransky <stransky@redhat.com>
Mon, 30 Nov 2015 05:26:00 +0100
changeset 309072 3ae71e279abd889857b9d0c0abd22a8203705624
parent 309071 d8000ef38139d5ea90a35c0ae13f4e3854920f08
child 309073 f29788babeaceac907bff4782e24c4560431dee5
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1228281
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1228281 - [GTK3] add padding to buttons. r=karlt
widget/gtk/gtk3drawing.c
--- a/widget/gtk/gtk3drawing.c
+++ b/widget/gtk/gtk3drawing.c
@@ -2693,30 +2693,29 @@ moz_gtk_get_widget_border(GtkThemeWidget
     case MOZ_GTK_BUTTON:
     case MOZ_GTK_TOOLBAR_BUTTON:
         {
             ensure_button_widget();
             style = gtk_widget_get_style_context(gButtonWidget);
 
             *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButtonWidget));
 
-            /* Don't add this padding in HTML, otherwise the buttons will
-               become too big and stuff the layout. */
-            if (!inhtml) {
-                if (widget == MOZ_GTK_TOOLBAR_BUTTON) {
-                    gtk_style_context_save(style);
-                    gtk_style_context_add_class(style, "image-button");
-                }
+            if (widget == MOZ_GTK_TOOLBAR_BUTTON) {
+                gtk_style_context_save(style);
+                gtk_style_context_add_class(style, "image-button");
+            }
               
-                moz_gtk_add_style_padding(style, left, top, right, bottom);
+            moz_gtk_add_style_padding(style, left, top, right, bottom);
                 
-                if (widget == MOZ_GTK_TOOLBAR_BUTTON)
-                    gtk_style_context_restore(style);
-            }
-
+            if (widget == MOZ_GTK_TOOLBAR_BUTTON)
+                gtk_style_context_restore(style);
+
+            // XXX: Subtract 1 pixel from the border to account for the added
+            // -moz-focus-inner border (Bug 1228281).
+            *left -= 1; *top -= 1; *right -= 1; *bottom -= 1;
             moz_gtk_add_style_border(style, left, top, right, bottom);
             return MOZ_GTK_SUCCESS;
         }
     case MOZ_GTK_ENTRY:
         {
             ensure_entry_widget();
             style = gtk_widget_get_style_context(gEntryWidget);