diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2011-01-07 18:59:58 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2011-01-07 19:04:01 +0900 |
commit | 528a0975c7d1cb34ae0e9065d53d06817bc66dbe (patch) | |
tree | ef51d9903ca95ba24bdac8d8f4825853c547a093 /gladeui/glade-inspector.c | |
parent | b9ca7797e235294c816861d481af1fe0b1dd506e (diff) | |
download | glade-528a0975c7d1cb34ae0e9065d53d06817bc66dbe.tar.gz |
* gladeui/glade-inspector.c: Updated to use GtkStyleContext to set the italic &
insensitive color for the < search widgets > entry.
Diffstat (limited to 'gladeui/glade-inspector.c')
-rw-r--r-- | gladeui/glade-inspector.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gladeui/glade-inspector.c b/gladeui/glade-inspector.c index 42ef71cb..8787f21a 100644 --- a/gladeui/glade-inspector.c +++ b/gladeui/glade-inspector.c @@ -349,11 +349,12 @@ search_entry_key_press_event_cb (GtkEntry * entry, static void widget_font_desc_set_style (GtkWidget * widget, PangoStyle style) { - PangoFontDescription *font_desc = - pango_font_description_copy (gtk_widget_get_style (widget)->font_desc); + GtkStyleContext *context = gtk_widget_get_style_context (widget); + PangoFontDescription *font_desc = + pango_font_description_copy (gtk_style_context_get_font (context, GTK_STATE_FLAG_NORMAL)); pango_font_description_set_style (font_desc, style); - gtk_widget_modify_font (widget, font_desc); + gtk_widget_override_font (widget, font_desc); pango_font_description_free (font_desc); } @@ -373,12 +374,16 @@ search_entry_update (GladeInspector * inspector) if (str[0] == '\0') { + GtkStyleContext *context; + GdkRGBA color; + priv->search_disabled = TRUE; widget_font_desc_set_style (priv->entry, PANGO_STYLE_ITALIC); gtk_entry_set_text (GTK_ENTRY (priv->entry), _("< search widgets >")); - gtk_widget_modify_text (priv->entry, GTK_STATE_NORMAL, - >k_widget_get_style (priv->entry)-> - text[GTK_STATE_INSENSITIVE]); + + context = gtk_widget_get_style_context (priv->entry); + gtk_style_context_get_color (context, GTK_STATE_FLAG_INSENSITIVE, &color); + gtk_widget_override_color (priv->entry, GTK_STATE_FLAG_NORMAL, &color); } } @@ -391,8 +396,9 @@ search_entry_focus_in_cb (GtkWidget * entry, if (priv->search_disabled) { gtk_entry_set_text (GTK_ENTRY (priv->entry), ""); - gtk_widget_modify_text (priv->entry, GTK_STATE_NORMAL, NULL); - gtk_widget_modify_font (priv->entry, NULL); + gtk_widget_override_color (priv->entry, GTK_STATE_NORMAL, NULL); + gtk_widget_override_font (priv->entry, NULL); + priv->search_disabled = FALSE; } |