diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2012-01-12 03:05:54 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2012-02-18 17:48:53 +0100 |
commit | 6d7ac9e87e13a7891d74a96a58aa000831c914a6 (patch) | |
tree | ec3e892b0ff1cf90a1728956d7cbcc4a1ac10d03 | |
parent | 607a1e8fc52d8bd3d094ba275636361f44916a68 (diff) | |
download | gtk+-6d7ac9e87e13a7891d74a96a58aa000831c914a6.tar.gz |
textview: Set background on the widget's window
The widget window is usually covered by the bin_window,
this is just necessary so the parent scrolled window
picks the right color for drawing the overshoot area.
-rw-r--r-- | gtk/gtktextview.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 3f59f1d465..7e0b43d0f2 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -3992,12 +3992,10 @@ gtk_text_view_realize (GtkWidget *widget) GtkTextView *text_view; GtkTextViewPrivate *priv; GtkStyleContext *context; - GtkStateFlags state; GdkWindow *window; GdkWindowAttr attributes; gint attributes_mask; GSList *tmp_list; - GdkRGBA color; text_view = GTK_TEXT_VIEW (widget); priv = text_view->priv; @@ -4023,10 +4021,11 @@ gtk_text_view_realize (GtkWidget *widget) gdk_window_set_user_data (window, widget); context = gtk_widget_get_style_context (widget); - state = gtk_widget_get_state_flags (widget); - gtk_style_context_get_background_color (context, state, &color); - gdk_window_set_background_rgba (window, &color); + gtk_style_context_save (context); + gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW); + gtk_style_context_set_background (context, window); + gtk_style_context_restore (context); text_window_realize (priv->text_window, widget); @@ -4126,16 +4125,14 @@ gtk_text_view_set_background (GtkTextView *text_view) gtk_style_context_save (context); gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW); - gtk_style_context_get_background_color (context, state, &color); - gdk_window_set_background_rgba (priv->text_window->bin_window, &color); + gtk_style_context_set_background (context, priv->text_window->bin_window); + gtk_style_context_set_background (context, gtk_widget_get_window (widget)); gtk_style_context_restore (context); /* Set lateral panes background */ gtk_style_context_get_background_color (context, state, &color); - gdk_window_set_background_rgba (gtk_widget_get_window (widget), &color); - if (priv->left_window) gdk_window_set_background_rgba (priv->left_window->bin_window, &color); |