summaryrefslogtreecommitdiff
path: root/gtk/gtktreeview.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-12-10 06:48:56 -0500
committerMatthias Clasen <mclasen@redhat.com>2014-12-10 10:01:30 -0500
commit94310506182cf7acf0738f76fe8e96aa322114b2 (patch)
treedd099fff09e58df73c2ce2090e73524769d13a98 /gtk/gtktreeview.c
parent6f2fff56fbb44f064d25ee65fb12f602b0fef965 (diff)
downloadgtk+-94310506182cf7acf0738f76fe8e96aa322114b2.tar.gz
GtkTreeView: Implement get_border
Add an implementation for the new scrollable vfunc that returns the header height as top border.
Diffstat (limited to 'gtk/gtktreeview.c')
-rw-r--r--gtk/gtktreeview.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 8c55dacda9..2c79b620a5 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -861,6 +861,9 @@ static GObject *gtk_tree_view_buildable_get_internal_child (GtkBuildable *b
const gchar *childname);
static void gtk_tree_view_buildable_init (GtkBuildableIface *iface);
+/* GtkScrollable */
+static void gtk_tree_view_scrollable_init (GtkScrollableInterface *iface);
+
static GtkAdjustment *gtk_tree_view_do_get_hadjustment (GtkTreeView *tree_view);
static void gtk_tree_view_do_set_hadjustment (GtkTreeView *tree_view,
GtkAdjustment *adjustment);
@@ -929,7 +932,8 @@ G_DEFINE_TYPE_WITH_CODE (GtkTreeView, gtk_tree_view, GTK_TYPE_CONTAINER,
G_ADD_PRIVATE (GtkTreeView)
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
gtk_tree_view_buildable_init)
- G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE,
+ gtk_tree_view_scrollable_init))
static void
gtk_tree_view_class_init (GtkTreeViewClass *class)
@@ -16544,3 +16548,18 @@ gtk_tree_view_get_tooltip_column (GtkTreeView *tree_view)
return tree_view->priv->tooltip_column;
}
+
+static gboolean
+gtk_tree_view_get_border (GtkScrollable *scrollable,
+ GtkBorder *border)
+{
+ border->top = _gtk_tree_view_get_header_height (GTK_TREE_VIEW (scrollable));
+
+ return TRUE;
+}
+
+static void
+gtk_tree_view_scrollable_init (GtkScrollableInterface *iface)
+{
+ iface->get_border = gtk_tree_view_get_border;
+}