summaryrefslogtreecommitdiff
path: root/widget/gtk/gtk3drawing.cpp
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2018-04-06 09:06:33 -0500
committertrav90 <travawine@protonmail.ch>2018-04-06 09:06:33 -0500
commitdfe72009d38d82f7cee61d458b8574fb9eddfb2e (patch)
tree7179ce2a2c6144e247c493872fd2be01120533f3 /widget/gtk/gtk3drawing.cpp
parent91d45b16307d5115edcfe8bd0e626d8269c30d13 (diff)
downloaduxp-dfe72009d38d82f7cee61d458b8574fb9eddfb2e.tar.gz
[GTK3] Introduce MOZ_GTK_TEXT_VIEW_TEXT and move MOZ_GTK_RESIZER to WidgetStyleCache
The style context for MOZ_GTK_TEXT_VIEW is now created by copying from the widget instead of caching a widget and using its context. No rendering changes are expected, unless themes are animating GtkTextView backgrounds.
Diffstat (limited to 'widget/gtk/gtk3drawing.cpp')
-rw-r--r--widget/gtk/gtk3drawing.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/widget/gtk/gtk3drawing.cpp b/widget/gtk/gtk3drawing.cpp
index 062a5c006d..7cd18e44ed 100644
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -897,8 +897,10 @@ moz_gtk_text_view_paint(cairo_t *cr, GdkRectangle* rect,
gtk_style_context_get_padding(style_frame, state_flags, &padding);
ReleaseStyleContext(style_frame);
+ // There is a separate "text" window, which provides the background behind
+ // the text.
GtkStyleContext* style =
- ClaimStyleContext(MOZ_GTK_TEXT_VIEW, direction, state_flags);
+ ClaimStyleContext(MOZ_GTK_TEXT_VIEW_TEXT, direction, state_flags);
gint xthickness = border.left + padding.left;
gint ythickness = border.top + padding.top;
@@ -1337,17 +1339,9 @@ moz_gtk_resizer_paint(cairo_t *cr, GdkRectangle* rect,
GtkWidgetState* state,
GtkTextDirection direction)
{
- GtkStyleContext* style;
-
- // gtk_render_handle() draws a background, so use GtkTextView and its
- // GTK_STYLE_CLASS_VIEW to match the background with textarea elements.
- // The resizer is drawn with shaded variants of the background color, and
- // so a transparent background would lead to a transparent resizer.
- style = ClaimStyleContext(MOZ_GTK_TEXT_VIEW, GTK_TEXT_DIR_LTR,
- GetStateFlagsFromGtkWidgetState(state));
- // TODO - we need to save/restore style when gtk 3.20 CSS node path
- // is used
- gtk_style_context_add_class(style, GTK_STYLE_CLASS_GRIP);
+ GtkStyleContext* style =
+ ClaimStyleContext(MOZ_GTK_RESIZER, GTK_TEXT_DIR_LTR,
+ GetStateFlagsFromGtkWidgetState(state));
// Workaround unico not respecting the text direction for resizers.
// See bug 1174248.