summaryrefslogtreecommitdiff
path: root/widget
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2018-04-06 09:18:33 -0500
committertrav90 <travawine@protonmail.ch>2018-04-06 09:18:33 -0500
commit3c30002e00b5bcd613012e49021b451761686dfe (patch)
tree6af430e94911f9b10ae6d4d0cad683c5e2570346 /widget
parent17a7b835d547b4b412458c10264bccde9e0767c5 (diff)
downloaduxp-3c30002e00b5bcd613012e49021b451761686dfe.tar.gz
[GTK3] Adjust textarea style contexts for GTK 3.20 theming ABI changes
Diffstat (limited to 'widget')
-rw-r--r--widget/gtk/WidgetStyleCache.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/widget/gtk/WidgetStyleCache.cpp b/widget/gtk/WidgetStyleCache.cpp
index e70e72bd36..aea657f518 100644
--- a/widget/gtk/WidgetStyleCache.cpp
+++ b/widget/gtk/WidgetStyleCache.cpp
@@ -876,19 +876,26 @@ GetCssNodeStyleInternal(WidgetNodeType aNodeType)
GTK_STYLE_CLASS_FRAME);
case MOZ_GTK_TEXT_VIEW_TEXT:
case MOZ_GTK_RESIZER:
- // TODO - create from CSS node
- style = GetWidgetStyleWithClass(MOZ_GTK_TEXT_VIEW, GTK_STYLE_CLASS_VIEW);
+ style = CreateChildCSSNode("text", MOZ_GTK_TEXT_VIEW);
if (aNodeType == MOZ_GTK_RESIZER) {
// The "grip" class provides the correct builtin icon from
// gtk_render_handle(). The icon is drawn with shaded variants of
// the background color, and so a transparent background would lead to
// a transparent resizer. gtk_render_handle() also uses the
// background color to draw a background, and so this style otherwise
- // matches MOZ_GTK_TEXT_VIEW_TEXT to match the background with
+ // matches what is used in GtkTextView to match the background with
// textarea elements.
+ GdkRGBA color;
+ gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL,
+ &color);
+ if (color.alpha == 0.0) {
+ g_object_unref(style);
+ style = CreateStyleForWidget(gtk_text_view_new(),
+ MOZ_GTK_SCROLLED_WINDOW);
+ }
gtk_style_context_add_class(style, GTK_STYLE_CLASS_GRIP);
}
- return style;
+ break;
case MOZ_GTK_FRAME_BORDER:
style = CreateChildCSSNode("border", MOZ_GTK_FRAME);
break;