aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorRadek Doulik <rodo@ximian.com>2004-06-09 23:03:56 +0800
committerRadek Doulik <rodo@src.gnome.org>2004-06-09 23:03:56 +0800
commit40256a9748eabaa2d4e9e83c10bfa20e5c007534 (patch)
tree3c6bb59ba54eb59ba5ed3f2fb75c0c59b14dca95 /widgets/table
parente79c7cbc001bccf6742876c1bc3a728a799dffbc (diff)
downloadgsoc2013-evolution-40256a9748eabaa2d4e9e83c10bfa20e5c007534.tar.gz
gsoc2013-evolution-40256a9748eabaa2d4e9e83c10bfa20e5c007534.tar.zst
gsoc2013-evolution-40256a9748eabaa2d4e9e83c10bfa20e5c007534.zip
new helper function to set step_increments (allocate_callback): call
2004-06-09 Radek Doulik <rodo@ximian.com> * e-table-field-chooser.c (ensure_nonzero_step_increments): new helper function to set step_increments (allocate_callback): call ensure_nonzero_step_increments (resize): ditto Fixes #48275 svn path=/trunk/; revision=26268
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-table-field-chooser.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c
index 5323a8499b..7da48d1322 100644
--- a/widgets/table/e-table-field-chooser.c
+++ b/widgets/table/e-table-field-chooser.c
@@ -94,6 +94,24 @@ e_table_field_chooser_class_init (ETableFieldChooserClass *klass)
G_PARAM_READWRITE));
}
+static void
+ensure_nonzero_step_increments (ETableFieldChooser *etfc)
+{
+ GtkAdjustment *va, *ha;
+
+ va = gtk_layout_get_vadjustment (GTK_LAYOUT (etfc->canvas));
+ ha = gtk_layout_get_hadjustment (GTK_LAYOUT (etfc->canvas));
+
+ /*
+ it looks pretty complicated to get height of column header
+ so use 16 pixels which should be OK
+ */
+ if (va && va->step_increment == 0.0)
+ va->step_increment = 16.0;
+ if (ha && ha->step_increment == 0.0)
+ ha->step_increment = 16.0;
+}
+
static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, ETableFieldChooser *etfc)
{
double height;
@@ -110,6 +128,7 @@ static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, ETab
"x2", (double) allocation->width,
"y2", (double) height,
NULL );
+ ensure_nonzero_step_increments (etfc);
}
static void resize(GnomeCanvas *canvas, ETableFieldChooser *etfc)
@@ -126,6 +145,7 @@ static void resize(GnomeCanvas *canvas, ETableFieldChooser *etfc)
"x2", (double) etfc->last_alloc.width,
"y2", (double) height,
NULL );
+ ensure_nonzero_step_increments (etfc);
}
static void