summaryrefslogtreecommitdiff
path: root/mozilla-1101582.patch
blob: c1963f87a867107fa5e8877876cacfdc11eee183 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# HG changeset patch
# Parent cef590a6f94681064fa954890bae6014db819158
# User Martin Stransky <stransky@redhat.com>
Bug 1101582 - [GTK3] - Use window background color for ThreeDFace,ButtonFace r=karlt
This fixes missing borders on non-natively-styled textareas.

diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp
--- a/widget/gtk/nsLookAndFeel.cpp
+++ b/widget/gtk/nsLookAndFeel.cpp
@@ -279,39 +279,41 @@ nsLookAndFeel::NativeGetColor(ColorID aI
         // scrollbar gray area
 #if (MOZ_WIDGET_GTK == 2)
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_ACTIVE]);
 #else
         aColor = sMozScrollbar;
 #endif
         break;
 
+    case eColorID_threedlightshadow:
+        // 3-D highlighted inner edge color
+        // always same as background in GTK code
     case eColorID_threedface:
     case eColorID_buttonface:
         // 3-D face color
-        aColor = sFrameBackground;
+#if (MOZ_WIDGET_GTK == 3)
+        aColor = sMozWindowBackground;
+#else
+        aColor = sButtonBackground;
+#endif
         break;
 
     case eColorID_buttontext:
         // text on push buttons
         aColor = sButtonText;
         break;
 
     case eColorID_buttonhighlight:
         // 3-D highlighted edge color
     case eColorID_threedhighlight:
         // 3-D highlighted outer edge color
         aColor = sFrameOuterLightBorder;
         break;
 
-    case eColorID_threedlightshadow:
-        // 3-D highlighted inner edge color
-        aColor = sFrameBackground; // always same as background in GTK code
-        break;
-
     case eColorID_buttonshadow:
         // 3-D shadow edge color
     case eColorID_threedshadow:
         // 3-D shadow inner edge color
         aColor = sFrameInnerDarkBorder;
         break;
 
 #if (MOZ_WIDGET_GTK == 2)
@@ -1136,17 +1138,17 @@ nsLookAndFeel::Init()
     }
 
     sOddCellBackground = GDK_COLOR_TO_NS_RGB(colorValue);
     if (colorValuePtr)
         gdk_color_free(colorValuePtr);
 
     style = gtk_widget_get_style(button);
     if (style) {
-        sFrameBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
+        sButtonBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
         sFrameOuterLightBorder =
             GDK_COLOR_TO_NS_RGB(style->light[GTK_STATE_NORMAL]);
         sFrameInnerDarkBorder =
             GDK_COLOR_TO_NS_RGB(style->dark[GTK_STATE_NORMAL]);
     }
 #else
     // Button text, background, border
     style = gtk_widget_get_style_context(label);
@@ -1184,22 +1186,19 @@ nsLookAndFeel::Init()
     gtk_style_context_add_region(style, GTK_STYLE_REGION_ROW, GTK_REGION_ODD);
     gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
     sOddCellBackground = GDK_RGBA_TO_NS_RGBA(color);
     gtk_style_context_restore(style);
 
     GtkWidget *frame = gtk_frame_new(nullptr);
     gtk_container_add(GTK_CONTAINER(parent), frame);
 
-    style = gtk_widget_get_style_context(frame);
-    gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
-    sFrameBackground = GDK_RGBA_TO_NS_RGBA(color);
-
     // TODO GTK3 - update sFrameOuterLightBorder 
     // for GTK_BORDER_STYLE_INSET/OUTSET/GROVE/RIDGE border styles (Bug 978172).
+    style = gtk_widget_get_style_context(frame);
     gtk_style_context_get_border_color(style, GTK_STATE_FLAG_NORMAL, &color);
     sFrameInnerDarkBorder = sFrameOuterLightBorder = GDK_RGBA_TO_NS_RGBA(color);
 #endif
     // Some themes have a unified menu bar, and support window dragging on it
     gboolean supports_menubar_drag = FALSE;
     GParamSpec *param_spec =
         gtk_widget_class_find_style_property(GTK_WIDGET_GET_CLASS(menuBar),
                                              "window-dragging");
diff --git a/widget/gtk/nsLookAndFeel.h b/widget/gtk/nsLookAndFeel.h
--- a/widget/gtk/nsLookAndFeel.h
+++ b/widget/gtk/nsLookAndFeel.h
@@ -59,17 +59,17 @@ protected:
     nscolor sMenuBackground;
     nscolor sMenuBarText;
     nscolor sMenuBarHoverText;
     nscolor sMenuText;
     nscolor sMenuHover;
     nscolor sMenuHoverText;
     nscolor sButtonText;
     nscolor sButtonHoverText;
-    nscolor sFrameBackground;
+    nscolor sButtonBackground;
     nscolor sFrameOuterLightBorder;
     nscolor sFrameInnerDarkBorder;
     nscolor sOddCellBackground;
     nscolor sNativeHyperLinkText;
     nscolor sComboBoxText;
     nscolor sComboBoxBackground;
     nscolor sMozFieldText;
     nscolor sMozFieldBackground;
bgstack15