diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-11-18 11:52:07 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-11-25 22:22:05 -0500 |
commit | 6475f26dfe5989df99c847dc8a7f70889e732242 (patch) | |
tree | 157a7e8f432d265e384f068e7d7757f665866c17 | |
parent | 3604a2a9fc2ce36e09c0d6a2d26ef8aeaec0c179 (diff) | |
download | glade-6475f26dfe5989df99c847dc8a7f70889e732242.tar.gz |
string list: Avoid GTK+ warnings
GTK+ warns nowadays if the state passed to gtk_style_context_get_*
does not match the state of the context. Avoid this by setting
the state beforehand.
https://bugzilla.gnome.org/show_bug.cgi?id=758300
-rw-r--r-- | plugins/gtk+/glade-string-list.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/gtk+/glade-string-list.c b/plugins/gtk+/glade-string-list.c index 292dfbc5..c4175a62 100644 --- a/plugins/gtk+/glade-string-list.c +++ b/plugins/gtk+/glade-string-list.c @@ -522,7 +522,10 @@ cell_data_func (GtkTreeViewColumn *column, if (dummy) { - gtk_style_context_get_color (context, GTK_STATE_FLAG_INSENSITIVE, &color); + gtk_style_context_save (context); + gtk_style_context_set_state (context, gtk_style_context_get_state (context) | GTK_STATE_FLAG_INSENSITIVE); + gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color); + gtk_style_context_restore (context); g_object_set (renderer, "style", PANGO_STYLE_ITALIC, "foreground-rgba", &color, @@ -530,7 +533,7 @@ cell_data_func (GtkTreeViewColumn *column, } else { - gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color); + gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color); g_object_set (renderer, "style", PANGO_STYLE_NORMAL, "foreground-rgba", &color, |