aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-cell-toggle.c
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2000-09-15 08:08:06 +0800
committerIain Holmes <iain@src.gnome.org>2000-09-15 08:08:06 +0800
commit22f72cc08e20c7871d93f05375fe2bafb0c1023a (patch)
treed765e7100abbfd00a916939716910b06e80e244c /widgets/table/e-cell-toggle.c
parent6d35f43ab255e79770f4be53c058a084fe9c6826 (diff)
downloadgsoc2013-evolution-22f72cc08e20c7871d93f05375fe2bafb0c1023a.tar
gsoc2013-evolution-22f72cc08e20c7871d93f05375fe2bafb0c1023a.tar.gz
gsoc2013-evolution-22f72cc08e20c7871d93f05375fe2bafb0c1023a.tar.bz2
gsoc2013-evolution-22f72cc08e20c7871d93f05375fe2bafb0c1023a.tar.lz
gsoc2013-evolution-22f72cc08e20c7871d93f05375fe2bafb0c1023a.tar.xz
gsoc2013-evolution-22f72cc08e20c7871d93f05375fe2bafb0c1023a.tar.zst
gsoc2013-evolution-22f72cc08e20c7871d93f05375fe2bafb0c1023a.zip
Fix some crashes Make double clicking on the header dividers automatically
Fix some crashes Make double clicking on the header dividers automatically size the header to it's best fit. When dragging onto the header check the dragged item is a header object. Check the column is resizeable before setting the cursor to <-> Use the font and themes to draw the table and items. svn path=/trunk/; revision=5438
Diffstat (limited to 'widgets/table/e-cell-toggle.c')
-rw-r--r--widgets/table/e-cell-toggle.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
index f0a05b488a..e18f4b33e7 100644
--- a/widgets/table/e-cell-toggle.c
+++ b/widgets/table/e-cell-toggle.c
@@ -223,6 +223,28 @@ etog_height (ECellView *ecell_view, int model_col, int view_col, int row)
return toggle->height;
}
+/*
+ * ECell::max_width method
+ */
+static int
+etog_max_width (ECellView *ecell_view, int model_col, int view_col)
+{
+ ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell);
+ void *_value = e_table_model_value_at (ecell_view->e_table_model, model_col, 0);
+ int max_width = gdk_pixbuf_get_width (toggle->images[GPOINTER_TO_INT (_value)]);
+ int number_of_rows;
+ int row;
+
+ number_of_rows = e_table_model_row_count (ecell_view->e_table_model);
+ for (row = 1; row < number_of_rows; row++) {
+ void *_value = e_table_model_value_at (ecell_view->e_table_model,
+ model_col, row);
+ max_width = MAX (max_width, gdk_pixbuf_get_width (toggle->images[GPOINTER_TO_INT (_value)]));
+ }
+
+ return max_width;
+}
+
static void
etog_destroy (GtkObject *object)
{
@@ -251,6 +273,7 @@ e_cell_toggle_class_init (GtkObjectClass *object_class)
ecc->draw = etog_draw;
ecc->event = etog_event;
ecc->height = etog_height;
+ ecc->max_width = etog_max_width;
parent_class = gtk_type_class (PARENT_TYPE);
}