aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-09 22:29:11 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-09 22:32:29 +0800
commit7a6b7673351c8597a5cf976d59fdd7fd246a78d5 (patch)
tree5c483fd9c569a93d1b51d9c79c7886f6b5ed777e /widgets/table
parente80b02e40cd630946e1898b1b988a14e21ee45c4 (diff)
downloadgsoc2013-evolution-7a6b7673351c8597a5cf976d59fdd7fd246a78d5.tar
gsoc2013-evolution-7a6b7673351c8597a5cf976d59fdd7fd246a78d5.tar.gz
gsoc2013-evolution-7a6b7673351c8597a5cf976d59fdd7fd246a78d5.tar.bz2
gsoc2013-evolution-7a6b7673351c8597a5cf976d59fdd7fd246a78d5.tar.lz
gsoc2013-evolution-7a6b7673351c8597a5cf976d59fdd7fd246a78d5.tar.xz
gsoc2013-evolution-7a6b7673351c8597a5cf976d59fdd7fd246a78d5.tar.zst
gsoc2013-evolution-7a6b7673351c8597a5cf976d59fdd7fd246a78d5.zip
ETree: Fix runtime warnings with GTK3.
ETable has a "vertical-spacing" style property, ETree does not. ECellText expects it to be in both.
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-cell-text.c15
-rw-r--r--widgets/table/e-table.c19
-rw-r--r--widgets/table/e-tree.c11
3 files changed, 33 insertions, 12 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 87febf7c09..4d86378904 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -681,12 +681,21 @@ show_pango_rectangle (CellEdit *edit, PangoRectangle rect)
}
static gint
-get_vertical_spacing (GtkWidget *widget)
+get_vertical_spacing (GtkWidget *canvas)
{
- GtkStyle *style = gtk_rc_get_style (widget);
+ GtkStyle *style;
+ GtkWidget *widget;
gint vspacing = 0;
- gtk_style_get (style, E_TABLE_TYPE, "vertical-spacing", &vspacing, NULL);
+ g_return_val_if_fail (E_IS_CANVAS (canvas), 3);
+
+ /* The parent should be either an ETable or ETree. */
+ widget = gtk_widget_get_parent (canvas);
+ style = gtk_widget_get_style (widget);
+
+ gtk_style_get (
+ style, G_OBJECT_TYPE (widget),
+ "vertical-spacing", &vspacing, NULL);
return vspacing;
}
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 4cbd6556af..4dc13bfb1a 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -3513,15 +3513,16 @@ e_table_class_init (ETableClass *class)
E_TABLE_MODEL_TYPE,
G_PARAM_READABLE));
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("vertical-spacing",
- "Vertical Row Spacing",
- "Vertical space between rows. It is added to top and to bottom of a row",
- 0,
- G_MAXINT,
- 3,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
+ gtk_widget_class_install_style_property (
+ widget_class,
+ g_param_spec_int (
+ "vertical-spacing",
+ "Vertical Row Spacing",
+ "Vertical space between rows. "
+ "It is added to top and to bottom of a row",
+ 0, G_MAXINT, 3,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
gal_a11y_e_table_init ();
}
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index 5f0effaac8..8d718b0235 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -3584,6 +3584,17 @@ e_tree_class_init (ETreeClass *class)
10,
G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (
+ widget_class,
+ g_param_spec_int (
+ "vertical-spacing",
+ "Vertical Row Spacing",
+ "Vertical space between rows. "
+ "It is added to top and to bottom of a row",
+ 0, G_MAXINT, 3,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
gal_a11y_e_tree_init ();
}