From 28b84ecaf9111f2a59e1380089dad6a92ddc848d Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 4 Jan 2010 22:52:24 -0500 Subject: Teach ETable to prefer themed icon names over pixbufs. --- calendar/gui/e-memo-table.c | 14 +++----------- calendar/gui/e-task-table.c | 21 +++++---------------- 2 files changed, 8 insertions(+), 27 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index ee67baa9ae..62c0b99e6e 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -87,12 +87,10 @@ static gpointer parent_class; static guint signals[LAST_SIGNAL]; /* The icons to represent the task. */ -#define NUM_ICONS 2 -static const gchar *icon_names[NUM_ICONS] = { +static const gchar *icon_names[] = { "stock_notes", "stock_insert-note" }; -static GdkPixbuf *icon_pixbufs[NUM_ICONS] = { NULL }; static void memo_table_emit_open_component (EMemoTable *memo_table, @@ -347,7 +345,6 @@ memo_table_constructed (GObject *object) ECalModel *model; ECell *cell, *popup_cell; ETableExtras *extras; - gint i; AtkObject *a11y; gchar *etspecfile; @@ -400,14 +397,9 @@ memo_table_constructed (GObject *object) /* Create pixmaps */ - if (!icon_pixbufs[0]) - for (i = 0; i < NUM_ICONS; i++) { - icon_pixbufs[i] = e_icon_factory_get_icon (icon_names[i], GTK_ICON_SIZE_MENU); - } - - cell = e_cell_toggle_new (0, NUM_ICONS, icon_pixbufs); + cell = e_cell_toggle_new (icon_names, G_N_ELEMENTS (icon_names)); e_table_extras_add_cell (extras, "icon", cell); - e_table_extras_add_pixbuf (extras, "icon", icon_pixbufs[0]); + e_table_extras_add_icon_name (extras, "icon", "stock_notes"); /* set proper format component for a default 'date' cell renderer */ cell = e_table_extras_get_cell (extras, "date"); diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index c4d364a930..5136a56b2d 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -91,14 +91,12 @@ static gpointer parent_class; static guint signals[LAST_SIGNAL]; /* The icons to represent the task. */ -#define NUM_ICONS 4 -static const gchar *icon_names[NUM_ICONS] = { +static const gchar *icon_names[] = { "stock_task", "stock_task-recurring", "stock_task-assigned", "stock_task-assigned-to" }; -static GdkPixbuf *icon_pixbufs[NUM_ICONS] = { NULL }; static void task_table_emit_open_component (ETaskTable *task_table, @@ -384,8 +382,6 @@ task_table_constructed (GObject *object) ECalModel *model; ECell *cell, *popup_cell; ETableExtras *extras; - gint i; - GdkPixbuf *pixbuf; GList *strings; AtkObject *a11y; gchar *etspecfile; @@ -575,18 +571,11 @@ task_table_constructed (GObject *object) /* Create pixmaps */ - if (!icon_pixbufs[0]) - for (i = 0; i < NUM_ICONS; i++) { - icon_pixbufs[i] = e_icon_factory_get_icon (icon_names[i], GTK_ICON_SIZE_MENU); - } - - cell = e_cell_toggle_new (0, NUM_ICONS, icon_pixbufs); - e_table_extras_add_cell(extras, "icon", cell); - e_table_extras_add_pixbuf(extras, "icon", icon_pixbufs[0]); + cell = e_cell_toggle_new (icon_names, G_N_ELEMENTS (icon_names)); + e_table_extras_add_cell (extras, "icon", cell); + e_table_extras_add_icon_name (extras, "icon", "stock_task"); - pixbuf = e_icon_factory_get_icon ("stock_check-filled", GTK_ICON_SIZE_MENU); - e_table_extras_add_pixbuf(extras, "complete", pixbuf); - g_object_unref(pixbuf); + e_table_extras_add_icon_name (extras, "complete", "stock_check-filled"); /* set proper format component for a default 'date' cell renderer */ cell = e_table_extras_get_cell (extras, "date"); -- cgit v1.2.3