diff options
author | Alexander Larsson <alexl@redhat.com> | 2014-07-27 15:41:01 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2014-07-28 16:23:33 +0200 |
commit | 4fe051bb4a017d2840f2b0f4299512971f17a837 (patch) | |
tree | b4b86eb9ecf10fce21db532d1a13e1e31c4b1b60 /gtk/gtktextview.c | |
parent | b584970b955297caed3074aa3874563eb7364ba7 (diff) | |
download | gtk+-4fe051bb4a017d2840f2b0f4299512971f17a837.tar.gz |
Revert "GtkTextView: Fix regression in GtkSourceView drawing"
This reverts commit 1ac13435b7c14dd9b97ad7a9d292acd51337d66e.
We want to instead replace this with special vfunc for drawing
below/above the main text so that gtksourceview can use it.
Diffstat (limited to 'gtk/gtktextview.c')
-rw-r--r-- | gtk/gtktextview.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 2fba210a30..40b25960a9 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -1491,13 +1491,6 @@ gtk_text_view_init (GtkTextView *text_view) priv->pixel_cache = _gtk_pixel_cache_new (); - /* Widgets inheriting from GtkTextView (like GtkSourceView) rely on being able to - paint before chaining up to GtkTextView.draw() and having that be visible, that - doesn't work unless we have alpha in the textview pixelcache. This is slightly - suboptimal, as it means drawing the cache is slower (and OVER operation) rather - than a pure blit, but is required for backwards compat. */ - _gtk_pixel_cache_set_content (priv->pixel_cache, CAIRO_CONTENT_COLOR_ALPHA); - /* Set up default style */ priv->wrap_mode = GTK_WRAP_NONE; priv->pixels_above_lines = 0; @@ -5318,6 +5311,18 @@ draw_text (cairo_t *cr, gpointer user_data) { GtkWidget *widget = user_data; + GtkStyleContext *context; + GdkRectangle bg_rect; + + gdk_cairo_get_clip_rectangle (cr, &bg_rect); + + context = gtk_widget_get_style_context (widget); + gtk_style_context_save (context); + gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW); + gtk_render_background (context, cr, + bg_rect.x, bg_rect.y, + bg_rect.width, bg_rect.height); + gtk_style_context_restore (context); gtk_text_view_paint (widget, cr); } |