[libhandy] leaflet: Add the get_child_by_name() method



commit 7d9a66ae22ad8c943f360e3971a21ad92ce0321c
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon Jul 20 08:36:57 2020 +0200

    leaflet: Add the get_child_by_name() method
    
    Because it doesn't hurt.

 debian/libhandy-1-0.symbols |  1 +
 src/hdy-leaflet.c           | 21 +++++++++++++++++++++
 src/hdy-leaflet.h           |  3 +++
 3 files changed, 25 insertions(+)
---
diff --git a/debian/libhandy-1-0.symbols b/debian/libhandy-1-0.symbols
index 8095c08b..627a5046 100644
--- a/debian/libhandy-1-0.symbols
+++ b/debian/libhandy-1-0.symbols
@@ -204,6 +204,7 @@ libhandy-1.so.0 libhandy-1-0 #MINVER#
  hdy_leaflet_get_adjacent_child@LIBHANDY_1_0 0.81.0
  hdy_leaflet_get_can_swipe_back@LIBHANDY_1_0 0.0.12
  hdy_leaflet_get_can_swipe_forward@LIBHANDY_1_0 0.0.12
+ hdy_leaflet_get_child_by_name@LIBHANDY_1_0 0.85.0
  hdy_leaflet_get_child_transition_duration@LIBHANDY_1_0 0.0~git20180429
  hdy_leaflet_get_child_transition_running@LIBHANDY_1_0 0.0~git20180429
  hdy_leaflet_get_folded@LIBHANDY_1_0 0.80.0
diff --git a/src/hdy-leaflet.c b/src/hdy-leaflet.c
index d64d0418..8fc05471 100644
--- a/src/hdy-leaflet.c
+++ b/src/hdy-leaflet.c
@@ -547,6 +547,27 @@ hdy_leaflet_navigate (HdyLeaflet             *self,
   return hdy_stackable_box_navigate (HDY_GET_HELPER (self), direction);
 }
 
+/**
+ * hdy_leaflet_get_child_by_name:
+ * @self: a #HdyLeaflet
+ * @name: the name of the child to find
+ *
+ * Finds the child of @self with the name given as the argument. Returns %NULL
+ * if there is no child with this name.
+ *
+ * Returns: (transfer none) (nullable): the requested child of @self
+ *
+ * Since: 1.0
+ */
+GtkWidget *
+hdy_leaflet_get_child_by_name (HdyLeaflet  *self,
+                               const gchar *name)
+{
+  g_return_val_if_fail (HDY_IS_LEAFLET (self), NULL);
+
+  return hdy_stackable_box_get_child_by_name (HDY_GET_HELPER (self), name);
+}
+
 /* This private method is prefixed by the call name because it will be a virtual
  * method in GTK 4.
  */
diff --git a/src/hdy-leaflet.h b/src/hdy-leaflet.h
index 6c1e006d..b9ff4157 100644
--- a/src/hdy-leaflet.h
+++ b/src/hdy-leaflet.h
@@ -77,4 +77,7 @@ GtkWidget       *hdy_leaflet_get_adjacent_child (HdyLeaflet             *self,
 gboolean         hdy_leaflet_navigate (HdyLeaflet             *self,
                                        HdyNavigationDirection  direction);
 
+GtkWidget       *hdy_leaflet_get_child_by_name (HdyLeaflet  *self,
+                                                const gchar *name);
+
 G_END_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]