]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-cell-renderer-expander.c
Merge branch 'gnome-3-8'
[empathy.git] / libempathy-gtk / empathy-cell-renderer-expander.c
index a38a0a5fb3fc12e7e9de4ee17e62199289694393..8653fae80551a0fb5ec969ebf74effb052f0d11e 100644 (file)
  * Authors: Kristian Rietveld <kris@imendio.com>
  */
 
-#include <gtk/gtk.h>
-
-#include <libempathy/empathy-utils.h>
+#include "config.h"
 #include "empathy-cell-renderer-expander.h"
 
+#include "empathy-utils.h"
+
 #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyCellRendererExpander)
 typedef struct {
        GtkExpanderStyle     expander_style;
@@ -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,