[libhandy] leaflet: Add get_adjacent_child()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy] leaflet: Add get_adjacent_child()
- Date: Tue, 2 Jun 2020 07:16:58 +0000 (UTC)
commit 769010a184d44e17d9b3d40be34b346cb0c3fc24
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Jun 2 00:17:08 2020 +0500
leaflet: Add get_adjacent_child()
Signed-off-by: Alexander Mikhaylenko <alexm gnome org>
src/hdy-leaflet.c | 23 +++++++++++++++++++++++
src/hdy-leaflet.h | 2 ++
2 files changed, 25 insertions(+)
---
diff --git a/src/hdy-leaflet.c b/src/hdy-leaflet.c
index f8e2729b..0addd255 100644
--- a/src/hdy-leaflet.c
+++ b/src/hdy-leaflet.c
@@ -504,6 +504,29 @@ hdy_leaflet_get_can_swipe_forward (HdyLeaflet *self)
return hdy_stackable_box_get_can_swipe_forward (HDY_GET_HELPER (self));
}
+/**
+ * hdy_leaflet_get_adjacent_child
+ * @self: a #HdyLeaflet
+ * @direction: the direction
+ *
+ * Gets the previous or next child that doesn't have 'allow-visible' child
+ * property set to %FALSE, or %NULL if it doesn't exist. This will be the same
+ * widget hdy_leaflet_navigate() will navigate to.
+ *
+ * Returns: (nullable) (transfer none): the previous or next child, or
+ * %NULL if it doesn't exist.
+ *
+ * Since: 1.0
+ */
+GtkWidget *
+hdy_leaflet_get_adjacent_child (HdyLeaflet *self,
+ HdyNavigationDirection direction)
+{
+ g_return_val_if_fail (HDY_IS_LEAFLET (self), NULL);
+
+ return hdy_stackable_box_get_adjacent_child (HDY_GET_HELPER (self), direction);
+}
+
/**
* hdy_leaflet_navigate
* @self: a #HdyLeaflet
diff --git a/src/hdy-leaflet.h b/src/hdy-leaflet.h
index 401db80d..096c1cac 100644
--- a/src/hdy-leaflet.h
+++ b/src/hdy-leaflet.h
@@ -73,6 +73,8 @@ gboolean hdy_leaflet_get_can_swipe_forward (HdyLeaflet *self);
void hdy_leaflet_set_can_swipe_forward (HdyLeaflet *self,
gboolean can_swipe_forward);
+GtkWidget *hdy_leaflet_get_adjacent_child (HdyLeaflet *self,
+ HdyNavigationDirection direction);
gboolean hdy_leaflet_navigate (HdyLeaflet *self,
HdyNavigationDirection direction);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]