summaryrefslogtreecommitdiff
path: root/mozilla-1073117-entry-button-size.patch
blob: 24c0ac2f8735c923abdc8248c32c781df343beca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# HG changeset patch
# Parent 70de2960aa877d7755ee6f66bf2d4c4c46bfed2c
# User Martin Stransky <stransky@redhat.com>
Bug 1073117 - Theme issues with GTK 3.14 - fix gtk button and entry size, r=?karlt
Theme borders has been removed in Gtk 3.14 so we can't use them to calculate button size.
Should computed as border + padding. Also update nsNativeThemeGTK::GetWidgetPadding() for that.

diff --git a/widget/gtk/gtk3drawing.c b/widget/gtk/gtk3drawing.c
--- a/widget/gtk/gtk3drawing.c
+++ b/widget/gtk/gtk3drawing.c
@@ -2686,25 +2686,23 @@ moz_gtk_get_widget_border(GtkThemeWidget
         {
             GtkBorder inner_border;
             gboolean interior_focus;
             gint focus_width, focus_pad;
 
             ensure_button_widget();
             *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButtonWidget));
 
+            style = gtk_widget_get_style_context(gButtonWidget);
+            moz_gtk_add_style_border(style, left, top, right, bottom);
+
             /* Don't add this padding in HTML, otherwise the buttons will
                become too big and stuff the layout. */
             if (!inhtml) {
-                moz_gtk_widget_get_focus(gButtonWidget, &interior_focus, &focus_width, &focus_pad);
-                moz_gtk_button_get_inner_border(gButtonWidget, &inner_border);
-                *left += focus_width + focus_pad + inner_border.left;
-                *right += focus_width + focus_pad + inner_border.right;
-                *top += focus_width + focus_pad + inner_border.top;
-                *bottom += focus_width + focus_pad + inner_border.bottom;
+                moz_gtk_add_style_padding(style, left, top, right, bottom);
             }
 
             moz_gtk_add_style_border(gtk_widget_get_style_context(gButtonWidget), 
                                      left, top, right, bottom);
             return MOZ_GTK_SUCCESS;
         }
     case MOZ_GTK_ENTRY:
         {
diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp
--- a/widget/gtk/nsNativeThemeGTK.cpp
+++ b/widget/gtk/nsNativeThemeGTK.cpp
@@ -992,16 +992,21 @@ nsNativeThemeGTK::GetWidgetPadding(nsDev
   switch (aWidgetType) {
     case NS_THEME_BUTTON_FOCUS:
     case NS_THEME_TOOLBAR_BUTTON:
     case NS_THEME_TOOLBAR_DUAL_BUTTON:
     case NS_THEME_TAB_SCROLLARROW_BACK:
     case NS_THEME_TAB_SCROLLARROW_FORWARD:
     case NS_THEME_DROPDOWN_BUTTON:
     case NS_THEME_TOOLBAR_BUTTON_DROPDOWN:
+    case NS_THEME_FOCUS_OUTLINE:
+    case NS_THEME_NUMBER_INPUT:
+    case NS_THEME_TEXTFIELD:
+    case NS_THEME_TEXTFIELD_MULTILINE:
+    case NS_THEME_BUTTON:
     case NS_THEME_BUTTON_ARROW_UP:
     case NS_THEME_BUTTON_ARROW_DOWN:
     case NS_THEME_BUTTON_ARROW_NEXT:
     case NS_THEME_BUTTON_ARROW_PREVIOUS:
     case NS_THEME_RANGE_THUMB:
     // Radios and checkboxes return a fixed size in GetMinimumWidgetSize
     // and have a meaningful baseline, so they can't have
     // author-specified padding.
bgstack15