Commit 923c852c authored by Germán Poo-Caamaño's avatar Germán Poo-Caamaño

gimpcellrenderertoggle: Synced against Gimp master

* Remove/replaced deprecated symbols
* Aware of different window scales
parent 456b3d15
......@@ -28,6 +28,7 @@
G_BEGIN_DECLS
#define GIMP_TYPE_CELL_RENDERER_TOGGLE (gimp_cell_renderer_toggle_get_type ())
#define GIMP_CELL_RENDERER_TOGGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CELL_RENDERER_TOGGLE, GimpCellRendererToggle))
#define GIMP_CELL_RENDERER_TOGGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CELL_RENDERER_TOGGLE, GimpCellRendererToggleClass))
......@@ -35,18 +36,19 @@ G_BEGIN_DECLS
#define GIMP_IS_CELL_RENDERER_TOGGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CELL_RENDERER_TOGGLE))
#define GIMP_CELL_RENDERER_TOGGLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CELL_RENDERER_TOGGLE, GimpCellRendererToggleClass))
typedef struct _GimpCellRendererToggle GimpCellRendererToggle;
typedef struct _GimpCellRendererToggleClass GimpCellRendererToggleClass;
typedef struct _GimpCellRendererTogglePrivate GimpCellRendererTogglePrivate;
typedef struct _GimpCellRendererToggleClass GimpCellRendererToggleClass;
struct _GimpCellRendererToggle
{
GtkCellRendererToggle parent_instance;
GtkCellRendererToggle parent_instance;
gchar *stock_id;
GtkIconSize stock_size;
GdkPixbuf *pixbuf;
GimpCellRendererTogglePrivate *priv;
};
typedef struct _GimpCellRendererToggle GimpCellRendererToggle;
struct _GimpCellRendererToggleClass
{
GtkCellRendererToggleClass parent_class;
......@@ -60,12 +62,16 @@ struct _GimpCellRendererToggleClass
void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
void (* _gimp_reserved5) (void);
void (* _gimp_reserved6) (void);
void (* _gimp_reserved7) (void);
void (* _gimp_reserved8) (void);
};
GType gimp_cell_renderer_toggle_get_type (void) G_GNUC_CONST;
GtkCellRenderer * gimp_cell_renderer_toggle_new (const gchar *stock_id);
GtkCellRenderer * gimp_cell_renderer_toggle_new (const gchar *icon_name);
void gimp_cell_renderer_toggle_clicked (GimpCellRendererToggle *cell,
const gchar *path,
......
......@@ -178,8 +178,9 @@ clear_rb_group (GtkTreeModel *model,
}
static void
ev_sidebar_layers_visibility_changed (GtkCellRendererToggle *cell,
ev_sidebar_layers_visibility_clicked (GtkCellRendererToggle *cell,
gchar *path_str,
GdkModifierType state,
EvSidebarLayers *ev_layers)
{
GtkTreeModel *model;
......@@ -256,11 +257,14 @@ ev_sidebar_layers_create_tree_view (EvSidebarLayers *ev_layers)
g_object_set (G_OBJECT (renderer),
"xpad", 0,
"ypad", 0,
"override-background", TRUE,
NULL);
g_signal_connect (renderer, "toggled",
G_CALLBACK (ev_sidebar_layers_visibility_changed),
g_signal_connect (renderer, "clicked",
G_CALLBACK (ev_sidebar_layers_visibility_clicked),
(gpointer)ev_layers);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_attributes (column, renderer,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment