[gtk+/scrollable-indicator] GtkTreeView: Implement get_border
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/scrollable-indicator] GtkTreeView: Implement get_border
- Date: Wed, 10 Dec 2014 11:53:45 +0000 (UTC)
commit b3c079bdb202ad70277b0ca8cc30a0539f194b6f
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Dec 10 06:48:56 2014 -0500
GtkTreeView: Implement get_border
Add an implementation for the new scrollable vfunc that returns
the header height as top border.
gtk/gtktreeview.c | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 8c55dac..2c79b62 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;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]