aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/misc/ChangeLog6
-rw-r--r--widgets/misc/e-multi-config-dialog.c41
-rw-r--r--widgets/table/ChangeLog6
-rw-r--r--widgets/table/e-cell-pixbuf.c55
4 files changed, 28 insertions, 80 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index c87ee04d38..029e2c20f6 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-24 Srinivasa Ragavan <sragavan@novell.com>
+
+ * e-multi-config-dialog.c: (canvas_realize),
+ (e_multi_config_dialog_add_page): Enable for Cairofication of the
+ settings dialogs's etable.
+
2008-01-11 Jeffrey Stedfast <fejj@novell.com>
Patch by Jean-Christophe BEGUE to fix bug #329692.
diff --git a/widgets/misc/e-multi-config-dialog.c b/widgets/misc/e-multi-config-dialog.c
index bd73f1d2de..6ebc66239c 100644
--- a/widgets/misc/e-multi-config-dialog.c
+++ b/widgets/misc/e-multi-config-dialog.c
@@ -214,45 +214,8 @@ e_multi_config_dialog_class_init (EMultiConfigDialogClass *class)
((color).blue & 0xff00) >> 8)
static void
-fill_in_pixbufs (EMultiConfigDialog *dialog, int row)
-{
- GdkPixbuf *original = e_table_model_value_at (dialog->priv->list_e_table_model, 1, row);
- GtkWidget *canvas;
- guint32 colors[3];
- int i;
-
- if (original == NULL)
- return;
-
- canvas = GTK_WIDGET (e_table_scrolled_get_table (E_TABLE_SCROLLED (dialog->priv->list_e_table))->table_canvas);
-
- colors[0] = RGB_COLOR (canvas->style->bg [GTK_STATE_SELECTED]);
- colors[1] = RGB_COLOR (canvas->style->bg [GTK_STATE_ACTIVE]);
- colors[2] = RGB_COLOR (canvas->style->base [GTK_STATE_NORMAL]);
-
- for (i = 0; i < 3; i++) {
- GdkPixbuf *pixbuf = gdk_pixbuf_composite_color_simple (original,
- gdk_pixbuf_get_width (original),
- gdk_pixbuf_get_height (original),
- GDK_INTERP_BILINEAR,
- 255,
- 1,
- colors[i], colors[i]);
- e_table_model_set_value_at (dialog->priv->list_e_table_model, i + 2, row, pixbuf);
- g_object_unref(pixbuf);
- }
-}
-
-static void
canvas_realize (GtkWidget *widget, EMultiConfigDialog *dialog)
{
- int i;
- int row_count;
-
- row_count = e_table_model_row_count (dialog->priv->list_e_table_model);
- for (i = 0; i < row_count; i++) {
- fill_in_pixbufs (dialog, i);
- }
}
@@ -385,10 +348,6 @@ e_multi_config_dialog_add_page (EMultiConfigDialog *dialog,
e_table_memory_store_insert (E_TABLE_MEMORY_STORE (priv->list_e_table_model), -1, NULL, title, icon, NULL, NULL, NULL);
- if (GTK_WIDGET_REALIZED (e_table_scrolled_get_table (E_TABLE_SCROLLED (dialog->priv->list_e_table))->table_canvas)) {
- fill_in_pixbufs (dialog, e_table_model_row_count (priv->list_e_table_model) - 1);
- }
-
page_no = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
create_page_container (description, GTK_WIDGET (page_widget)),
NULL);
diff --git a/widgets/table/ChangeLog b/widgets/table/ChangeLog
index 30d266f683..18765c3600 100644
--- a/widgets/table/ChangeLog
+++ b/widgets/table/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-24 Srinivasa Ragavan <sragavan@novell.com>
+
+ * e-cell-pixbuf.c: (pixbuf_draw), (pixbuf_height), (pixbuf_print),
+ (pixbuf_print_height), (pixbuf_max_width): Cairfy pixbuf renderer for
+ settings window.
+
2008-01-22 Milan Crha <mcrha@redhat.com>
** Fix for bug #511105
diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c
index 36fd8a49b3..2dc98d367b 100644
--- a/widgets/table/e-cell-pixbuf.c
+++ b/widgets/table/e-cell-pixbuf.c
@@ -115,31 +115,11 @@ pixbuf_draw (ECellView *ecell_view, GdkDrawable *drawable,
GdkPixbuf *cell_pixbuf;
int real_x, real_y, real_w, real_h;
int pix_w, pix_h;
- ECellPixbuf *ecp;
-
- cell_pixbuf = NULL;
+ cairo_t *cr;
+
+ cell_pixbuf = e_table_model_value_at (ecell_view->e_table_model,
+ 1, row);
- ecp = E_CELL_PIXBUF (ecell_view->ecell);
-
- if (flags & E_CELL_SELECTED) {
- if (GTK_WIDGET_HAS_FOCUS (GNOME_CANVAS_ITEM (ecell_view->e_table_item_view)->canvas)) {
- if (ecp->focused_column != -1)
- cell_pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model,
- ecp->focused_column, row);
- } else {
- if (ecp->selected_column != -1)
- cell_pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model,
- ecp->selected_column, row);
- }
- } else {
- if (ecp->unselected_column != -1)
- cell_pixbuf = e_table_model_value_at (ecell_view->e_table_model,
- ecp->unselected_column, row);
- }
-
- if (cell_pixbuf == NULL)
- cell_pixbuf = e_table_model_value_at (ecell_view->e_table_model,
- model_col, row);
/* we can't make sure we really got a pixbuf since, well, it's a Gdk thing */
if (x2 - x1 == 0)
@@ -170,15 +150,12 @@ pixbuf_draw (ECellView *ecell_view, GdkDrawable *drawable,
real_h = y2 - y1;
}
-
- gdk_draw_pixbuf (drawable,
- NULL,
- cell_pixbuf,
- 0, 0,
- real_x, real_y,
- real_w, real_h,
- GDK_RGB_DITHER_NORMAL,
- 0, 0);
+ cr = gdk_cairo_create (drawable);
+ cairo_save (cr);
+ gdk_cairo_set_source_pixbuf (cr, cell_pixbuf, real_x, real_y);
+ cairo_paint_with_alpha (cr, 1);
+ cairo_restore (cr);
+ cairo_destroy (cr);
}
static gint
@@ -203,7 +180,7 @@ pixbuf_height (ECellView *ecell_view, int model_col, int view_col, int row)
}
}
- pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, model_col, row);
+ pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, 1, row);
if (!pixbuf)
return 0;
@@ -223,7 +200,7 @@ pixbuf_print (ECellView *ecell_view, GtkPrintContext *context,
int scale;
cairo_t *cr = gtk_print_context_get_cairo_context (context);
- pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, model_col, row);
+ pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, 1, row);
if (pixbuf == NULL)
return;
@@ -250,7 +227,7 @@ pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context,
}
}
- pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, model_col, row);
+ pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, 1, row);
if (!pixbuf)
return 0;
@@ -271,10 +248,10 @@ pixbuf_max_width (ECellView *ecell_view, int model_col, int view_col)
for (i = 0; i <= num_rows; i++) {
GdkPixbuf *pixbuf = (GdkPixbuf *) e_table_model_value_at
(ecell_view->e_table_model,
- model_col,
+ 1,
i);
- if (!pixbuf)
- continue;
+ if (!pixbuf)
+ continue;
pw = gdk_pixbuf_get_width (pixbuf);
if (max_width < pw)
max_width = pw;