[glade] string list: Avoid GTK+ warnings
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] string list: Avoid GTK+ warnings
- Date: Thu, 26 Nov 2015 03:23:09 +0000 (UTC)
commit 6475f26dfe5989df99c847dc8a7f70889e732242
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Nov 18 11:52:07 2015 -0500
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
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 292dfbc..c4175a6 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]