[ekiga] GmCellRendererExpander: Fixed impossibility to (un)fold groups.



commit 82072284c6e8a55c48e517d90b924265be6a9362
Author: Damien Sandras <dsandras beip be>
Date:   Sun Mar 17 15:29:23 2013 +0100

    GmCellRendererExpander: Fixed impossibility to (un)fold groups.

 lib/gui/gmcellrendererexpander.c |   45 ++++++++++++++++---------------------
 lib/gui/gmcellrendererexpander.h |   14 ++++++------
 2 files changed, 27 insertions(+), 32 deletions(-)
---
diff --git a/lib/gui/gmcellrendererexpander.c b/lib/gui/gmcellrendererexpander.c
index 22a227f..55e4531 100644
--- a/lib/gui/gmcellrendererexpander.c
+++ b/lib/gui/gmcellrendererexpander.c
@@ -30,7 +30,7 @@ typedef struct {
        gint                 expander_size;
 
        guint                activatable : 1;
-} EmpathyCellRendererExpanderPriv;
+} GmCellRendererExpanderPriv;
 
 enum {
        PROP_0,
@@ -69,13 +69,13 @@ static gboolean gm_cell_renderer_expander_activate     (GtkCellRenderer
                                                         const GdkRectangle              *cell_area,
                                                         GtkCellRendererState             flags);
 
-G_DEFINE_TYPE (EmpathyCellRendererExpander, gm_cell_renderer_expander, GTK_TYPE_CELL_RENDERER)
+G_DEFINE_TYPE (GmCellRendererExpander, gm_cell_renderer_expander, GTK_TYPE_CELL_RENDERER)
 
 static void
-gm_cell_renderer_expander_init (EmpathyCellRendererExpander *expander)
+gm_cell_renderer_expander_init (GmCellRendererExpander *expander)
 {
-       EmpathyCellRendererExpanderPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (expander,
-               GM_TYPE_CELL_RENDERER_EXPANDER, EmpathyCellRendererExpanderPriv);
+       GmCellRendererExpanderPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (expander,
+               GM_TYPE_CELL_RENDERER_EXPANDER, GmCellRendererExpanderPriv);
 
        expander->priv = priv;
        priv->expander_style = GTK_EXPANDER_COLLAPSED;
@@ -90,7 +90,7 @@ gm_cell_renderer_expander_init (EmpathyCellRendererExpander *expander)
 }
 
 static void
-gm_cell_renderer_expander_class_init (EmpathyCellRendererExpanderClass *klass)
+gm_cell_renderer_expander_class_init (GmCellRendererExpanderClass *klass)
 {
        GObjectClass         *object_class;
        GtkCellRendererClass *cell_class;
@@ -134,7 +134,7 @@ gm_cell_renderer_expander_class_init (EmpathyCellRendererExpanderClass *klass)
                                                               TRUE,
                                                               G_PARAM_READWRITE));
 
-       g_type_class_add_private (object_class, sizeof (EmpathyCellRendererExpanderPriv));
+       g_type_class_add_private (object_class, sizeof (GmCellRendererExpanderPriv));
 }
 
 static void
@@ -143,8 +143,8 @@ gm_cell_renderer_expander_get_property (GObject    *object,
                                         GValue     *value,
                                         GParamSpec *pspec)
 {
-       EmpathyCellRendererExpander     *expander;
-       EmpathyCellRendererExpanderPriv *priv;
+       GmCellRendererExpander     *expander;
+       GmCellRendererExpanderPriv *priv;
 
        expander = GM_CELL_RENDERER_EXPANDER (object);
        priv = expander->priv;
@@ -174,8 +174,8 @@ gm_cell_renderer_expander_set_property (GObject      *object,
                                         const GValue *value,
                                         GParamSpec   *pspec)
 {
-       EmpathyCellRendererExpander     *expander;
-       EmpathyCellRendererExpanderPriv *priv;
+       GmCellRendererExpander     *expander;
+       GmCellRendererExpanderPriv *priv;
 
        expander = GM_CELL_RENDERER_EXPANDER (object);
        priv = expander->priv;
@@ -220,12 +220,12 @@ gm_cell_renderer_expander_get_size (GtkCellRenderer         *cell,
                                     gint                    *width,
                                     gint                    *height)
 {
-       EmpathyCellRendererExpander     *expander;
-       EmpathyCellRendererExpanderPriv *priv;
+       GmCellRendererExpander     *expander;
+       GmCellRendererExpanderPriv *priv;
        gfloat xalign, yalign;
        guint xpad, ypad;
 
-       expander = (EmpathyCellRendererExpander *) cell;
+       expander = (GmCellRendererExpander *) cell;
        priv = expander->priv;
 
        g_object_get (cell,
@@ -268,14 +268,14 @@ gm_cell_renderer_expander_render (GtkCellRenderer                    *cell,
                                  const GdkRectangle                 *cell_area,
                                  GtkCellRendererState               flags)
 {
-       EmpathyCellRendererExpander     *expander;
-       EmpathyCellRendererExpanderPriv *priv;
+       GmCellRendererExpander     *expander;
+       GmCellRendererExpanderPriv *priv;
        gint                            x_offset, y_offset;
        guint                           xpad, ypad;
        GtkStyleContext                 *style;
        GtkStateFlags                    state;
 
-       expander = (EmpathyCellRendererExpander *) cell;
+       expander = (GmCellRendererExpander *) cell;
        priv = expander->priv;
 
        gm_cell_renderer_expander_get_size (cell, widget,
@@ -321,11 +321,11 @@ gm_cell_renderer_expander_activate (GtkCellRenderer                    *cell,
                                     G_GNUC_UNUSED const GdkRectangle   *cell_area,
                                     G_GNUC_UNUSED GtkCellRendererState flags)
 {
-       EmpathyCellRendererExpander     *expander;
-       EmpathyCellRendererExpanderPriv *priv;
+       GmCellRendererExpander     *expander;
+       GmCellRendererExpanderPriv *priv;
        GtkTreePath                     *path;
 
-       expander = (EmpathyCellRendererExpander *) cell;
+       expander = (GmCellRendererExpander *) cell;
        priv = expander->priv;
 
        if (!GTK_IS_TREE_VIEW (widget) || !priv->activatable)
@@ -333,11 +333,6 @@ gm_cell_renderer_expander_activate (GtkCellRenderer                    *cell,
 
        path = gtk_tree_path_new_from_string (path_string);
 
-       if (gtk_tree_path_get_depth (path) > 1) {
-               gtk_tree_path_free (path);
-               return TRUE;
-       }
-
        if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (widget), path)) {
                gtk_tree_view_collapse_row (GTK_TREE_VIEW (widget), path);
        } else {
diff --git a/lib/gui/gmcellrendererexpander.h b/lib/gui/gmcellrendererexpander.h
index a6e9f95..2b4c224 100644
--- a/lib/gui/gmcellrendererexpander.h
+++ b/lib/gui/gmcellrendererexpander.h
@@ -28,21 +28,21 @@
 G_BEGIN_DECLS
 
 #define GM_TYPE_CELL_RENDERER_EXPANDER         (gm_cell_renderer_expander_get_type ())
-#define GM_CELL_RENDERER_EXPANDER(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GM_TYPE_CELL_RENDERER_EXPANDER, EmpathyCellRendererExpander))
-#define GM_CELL_RENDERER_EXPANDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), 
GM_TYPE_CELL_RENDERER_EXPANDER, EmpathyCellRendererExpanderClass))
+#define GM_CELL_RENDERER_EXPANDER(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GM_TYPE_CELL_RENDERER_EXPANDER, GmCellRendererExpander))
+#define GM_CELL_RENDERER_EXPANDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), 
GM_TYPE_CELL_RENDERER_EXPANDER, GmCellRendererExpanderClass))
 #define GM_IS_CELL_RENDERER_EXPANDER(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GM_TYPE_CELL_RENDERER_EXPANDER))
 #define GM_IS_CELL_RENDERER_EXPANDER_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), 
GM_TYPE_CELL_RENDERER_EXPANDER))
-#define GM_CELL_RENDERER_EXPANDER_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), 
GM_TYPE_CELL_RENDERER_EXPANDER, EmpathyCellRendererExpanderClass))
+#define GM_CELL_RENDERER_EXPANDER_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), 
GM_TYPE_CELL_RENDERER_EXPANDER, GmCellRendererExpanderClass))
 
-typedef struct _EmpathyCellRendererExpander EmpathyCellRendererExpander;
-typedef struct _EmpathyCellRendererExpanderClass EmpathyCellRendererExpanderClass;
+typedef struct _GmCellRendererExpander GmCellRendererExpander;
+typedef struct _GmCellRendererExpanderClass GmCellRendererExpanderClass;
 
-struct _EmpathyCellRendererExpander {
+struct _GmCellRendererExpander {
   GtkCellRenderer parent;
   gpointer priv;
 };
 
-struct _EmpathyCellRendererExpanderClass {
+struct _GmCellRendererExpanderClass {
   GtkCellRendererClass parent_class;
 
   /* Padding for future expansion */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]