aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-cell-renderer-expander.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-05-19 22:11:44 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2011-05-23 21:55:26 +0800
commitd0e556d4cea9f4a12825eada17ab22648ee3fa9c (patch)
tree974e47758bf127a8e3b0d67d99f63ba23dbe85ac /libempathy-gtk/empathy-cell-renderer-expander.c
parent380911d4b3da972b98e97eeb9935227657b01962 (diff)
downloadgsoc2013-empathy-d0e556d4cea9f4a12825eada17ab22648ee3fa9c.tar
gsoc2013-empathy-d0e556d4cea9f4a12825eada17ab22648ee3fa9c.tar.gz
gsoc2013-empathy-d0e556d4cea9f4a12825eada17ab22648ee3fa9c.tar.bz2
gsoc2013-empathy-d0e556d4cea9f4a12825eada17ab22648ee3fa9c.tar.lz
gsoc2013-empathy-d0e556d4cea9f4a12825eada17ab22648ee3fa9c.tar.xz
gsoc2013-empathy-d0e556d4cea9f4a12825eada17ab22648ee3fa9c.tar.zst
gsoc2013-empathy-d0e556d4cea9f4a12825eada17ab22648ee3fa9c.zip
cell-renderer-expander: fix rendering with GTK+3
There are basically three issues here: - the renderer doesn't add the GTK_STYLE_CLASS_EXPANDER style class when rendering, which blocks the theme to apply the intended colors. - the GtkStateFlags that were set on the context were using GTK_STATE_* instead of GTK_STATE_FLAG_* - the flags set on the context were incomplete, as they were just using ACTIVE/NORMAL for expanded/collapsed and not SELECTED/FOCUSED/... https://bugzilla.gnome.org/show_bug.cgi?id=650590
Diffstat (limited to 'libempathy-gtk/empathy-cell-renderer-expander.c')
-rw-r--r--libempathy-gtk/empathy-cell-renderer-expander.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-cell-renderer-expander.c b/libempathy-gtk/empathy-cell-renderer-expander.c
index a38a0a5fb..7ed62b41f 100644
--- a/libempathy-gtk/empathy-cell-renderer-expander.c
+++ b/libempathy-gtk/empathy-cell-renderer-expander.c
@@ -275,6 +275,7 @@ empathy_cell_renderer_expander_render (GtkCellRenderer *cell,
gint x_offset, y_offset;
guint xpad, ypad;
GtkStyleContext *style;
+ GtkStateFlags state;
expander = (EmpathyCellRendererExpander *) cell;
priv = GET_PRIV (expander);
@@ -292,11 +293,16 @@ empathy_cell_renderer_expander_render (GtkCellRenderer *cell,
style = gtk_widget_get_style_context (widget);
gtk_style_context_save (style);
+ gtk_style_context_add_class (style, GTK_STYLE_CLASS_EXPANDER);
+
+ state = gtk_cell_renderer_get_state (cell, widget, flags);
if (priv->expander_style == GTK_EXPANDER_COLLAPSED)
- gtk_style_context_set_state (style, GTK_STATE_NORMAL);
+ state |= GTK_STATE_FLAG_NORMAL;
else
- gtk_style_context_set_state (style, GTK_STATE_ACTIVE);
+ state |= GTK_STATE_FLAG_ACTIVE;
+
+ gtk_style_context_set_state (style, state);
gtk_render_expander (style,
cr,