[libadwaita/wip/exalm/tab-overview: 11/15] tab-list-base: Add get_selected_item()




commit b079d0ae7aa9d56d00137419204c06697bf80afc
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat Aug 21 19:09:03 2021 +0500

    tab-list-base: Add get_selected_item()

 src/adw-tab-list-base-private.h |  2 ++
 src/adw-tab-list-base.c         | 15 +++++++++++++++
 2 files changed, 17 insertions(+)
---
diff --git a/src/adw-tab-list-base-private.h b/src/adw-tab-list-base-private.h
index adf77a22..892f5346 100644
--- a/src/adw-tab-list-base-private.h
+++ b/src/adw-tab-list-base-private.h
@@ -61,4 +61,6 @@ gboolean adw_tab_list_base_get_inverted (AdwTabListBase *self);
 void     adw_tab_list_base_set_inverted (AdwTabListBase *self,
                                          gboolean        inverted);
 
+GtkWidget *adw_tab_list_base_get_selected_item (AdwTabListBase *self);
+
 G_END_DECLS
diff --git a/src/adw-tab-list-base.c b/src/adw-tab-list-base.c
index c3765e22..5b01cc90 100644
--- a/src/adw-tab-list-base.c
+++ b/src/adw-tab-list-base.c
@@ -3807,3 +3807,18 @@ adw_tab_list_base_set_inverted (AdwTabListBase *self,
     adw_tab_item_set_inverted (info->tab, inverted);
   }
 }
+
+GtkWidget *
+adw_tab_list_base_get_selected_item (AdwTabListBase *self)
+{
+  AdwTabListBasePrivate *priv;
+
+  g_return_val_if_fail (ADW_IS_TAB_LIST_BASE (self), NULL);
+
+  priv = adw_tab_list_base_get_instance_private (self);
+
+  if (priv->selected_tab)
+    return GTK_WIDGET (priv->selected_tab->tab);
+
+  return NULL;
+}


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