summaryrefslogtreecommitdiff
path: root/gtk/gtkscrollable.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-12-10 06:45:21 -0500
committerMatthias Clasen <mclasen@redhat.com>2014-12-10 10:01:30 -0500
commit6f2fff56fbb44f064d25ee65fb12f602b0fef965 (patch)
treece7cec4bbfe582075872f84c351320b11049bd92 /gtk/gtkscrollable.c
parent691c96db2a0041ef1f3eecb5d0bf00b6c67c6cdf (diff)
downloadgtk+-6f2fff56fbb44f064d25ee65fb12f602b0fef965.tar.gz
Add a gtk_scrollable_get_border
Add a vfunc to return a non-scrollable border around scrollables. This would be nicer as a property, but we can't add properties to an interface without breaking 3rd party implementations, so make this an optional vfunc, and handle it not being set.
Diffstat (limited to 'gtk/gtkscrollable.c')
-rw-r--r--gtk/gtkscrollable.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gtk/gtkscrollable.c b/gtk/gtkscrollable.c
index 20028782ae..1ac26b625d 100644
--- a/gtk/gtkscrollable.c
+++ b/gtk/gtkscrollable.c
@@ -312,3 +312,31 @@ gtk_scrollable_set_vscroll_policy (GtkScrollable *scrollable,
g_object_set (scrollable, "vscroll-policy", policy, NULL);
}
+
+/**
+ * gtk_scrollable_get_border:
+ * @scrollable: a #GtkScrollable
+ * @border: return location for the results
+ *
+ * Returns the size of a non-scrolling border around the
+ * outside of the scrollable. An example for this would
+ * be treeview headers. GTK+ can use this information to
+ * display overlayed graphics, like the overshoot indication,
+ * at the right position.
+ *
+ * Returns: %TRUE if @border has been set
+ *
+ * Since: 3.16
+ */
+gboolean
+gtk_scrollable_get_border (GtkScrollable *scrollable,
+ GtkBorder *border)
+{
+ g_return_val_if_fail (GTK_IS_SCROLLABLE (scrollable), FALSE);
+ g_return_val_if_fail (border != NULL, FALSE);
+
+ if (GTK_SCROLLABLE_GET_IFACE (scrollable)->get_border)
+ return GTK_SCROLLABLE_GET_IFACE (scrollable)->get_border (scrollable, border);
+
+ return FALSE;
+}