diff options
author | Benjamin Otte <otte@redhat.com> | 2010-12-15 12:44:16 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-12-15 14:51:26 +0100 |
commit | 211ccb5c73a444683d493588c3eb29b457a5586b (patch) | |
tree | 470d4def5ab4853b239c60ed786067701b3ac67a /modules/input | |
parent | d3ed729643078b8fd7a64808c166ca2081178c02 (diff) | |
download | gtk+-211ccb5c73a444683d493588c3eb29b457a5586b.tar.gz |
xim: Fix for new style code
Diffstat (limited to 'modules/input')
-rw-r--r-- | modules/input/gtkimcontextxim.c | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/modules/input/gtkimcontextxim.c b/modules/input/gtkimcontextxim.c index 035edc3a00..a6adf9f280 100644 --- a/modules/input/gtkimcontextxim.c +++ b/modules/input/gtkimcontextxim.c @@ -1755,14 +1755,19 @@ static gboolean on_status_window_draw (GtkWidget *widget, cairo_t *cr) { - GtkStyle *style; + GtkStyleContext *style; + GdkRGBA color; - style = gtk_widget_get_style (widget); + style = gtk_widget_get_style_context (widget); - gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_NORMAL]); + gtk_style_context_get_background_color (style, 0, &color); + gdk_cairo_set_source_rgba (cr, &color); + cairo_paint (cr); + + gtk_style_context_get_color (style, 0, &color); + gdk_cairo_set_source_rgba (cr, &color); cairo_paint (cr); - gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]); cairo_rectangle (cr, 0, 0, gtk_widget_get_allocated_width (widget) - 1, @@ -1772,26 +1777,6 @@ on_status_window_draw (GtkWidget *widget, return FALSE; } -/* We watch the ::style-set signal for our label widget - * and use that to change it's foreground color to match - * the 'text' color of the toplevel window. The text/base - * pair of colors might be reversed from the fg/bg pair - * that are normally used for labels. - */ -static void -on_status_window_style_set (GtkWidget *toplevel, - GtkStyle *previous_style, - GtkWidget *label) -{ - GtkStyle *style; - gint i; - - style = gtk_widget_get_style (toplevel); - - for (i = 0; i < 5; i++) - gtk_widget_modify_fg (label, i, &style->text[i]); -} - /* Creates the widgets for the status window; called when we * first need to show text for the status window. */ @@ -1811,8 +1796,6 @@ status_window_make_window (StatusWindow *status_window) gtk_misc_set_padding (GTK_MISC (status_label), 1, 1); gtk_widget_show (status_label); - g_signal_connect (window, "style-set", - G_CALLBACK (on_status_window_style_set), status_label); gtk_container_add (GTK_CONTAINER (window), status_label); g_signal_connect (window, "draw", |