[libadwaita/wip/exalm/tab-overview: 8/15] tab-list-base: Drop AdwTab dependency
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/tab-overview: 8/15] tab-list-base: Drop AdwTab dependency
- Date: Tue, 12 Oct 2021 08:51:31 +0000 (UTC)
commit d6c0158bd9ff944638686ba9b36893b3bf880af3
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sat Aug 21 04:03:08 2021 +0500
tab-list-base: Drop AdwTab dependency
Allow subclasses to use different item types
src/adw-tab-box.c | 4 ++++
src/adw-tab-list-base-private.h | 2 ++
src/adw-tab-list-base.c | 5 ++---
3 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/adw-tab-box.c b/src/adw-tab-box.c
index 729a4c84..d4009c09 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -9,6 +9,8 @@
#include "config.h"
#include "adw-tab-box-private.h"
+#include "adw-tab-private.h"
+
struct _AdwTabBox
{
AdwTabListBase parent_instance;
@@ -34,6 +36,8 @@ adw_tab_box_class_init (AdwTabBoxClass *klass)
base_class->tabs_have_visible_focus = adw_tab_box_tabs_have_visible_focus;
+ base_class->item_type = ADW_TYPE_TAB;
+
gtk_widget_class_set_css_name (widget_class, "tabbox");
}
diff --git a/src/adw-tab-list-base-private.h b/src/adw-tab-list-base-private.h
index e196bd29..adf77a22 100644
--- a/src/adw-tab-list-base-private.h
+++ b/src/adw-tab-list-base-private.h
@@ -25,6 +25,8 @@ struct _AdwTabListBaseClass
{
GtkWidgetClass parent_class;
+ GType item_type;
+
gboolean (*tabs_have_visible_focus) (AdwTabListBase *self);
};
diff --git a/src/adw-tab-list-base.c b/src/adw-tab-list-base.c
index ab96a0b6..c3765e22 100644
--- a/src/adw-tab-list-base.c
+++ b/src/adw-tab-list-base.c
@@ -13,7 +13,6 @@
#include "adw-animation-util-private.h"
#include "adw-animation-private.h"
#include "adw-gizmo-private.h"
-#include "adw-tab-private.h"
#include "adw-tab-item-private.h"
#include "adw-tab-view-private.h"
#include <math.h>
@@ -1714,7 +1713,7 @@ create_tab_info (AdwTabListBase *self,
info->page = page;
info->pos = -1;
info->width = -1;
- info->tab = g_object_new (ADW_TYPE_TAB,
+ info->tab = g_object_new (ADW_TAB_LIST_BASE_GET_CLASS (self)->item_type,
"view", priv->view,
"pinned", priv->pinned,
NULL);
@@ -2353,7 +2352,7 @@ create_drag_icon (AdwTabListBase *self,
icon->width = predict_tab_width (self, priv->reordered_tab, FALSE);
icon->target_width = icon->width;
- icon->tab = g_object_new (ADW_TYPE_TAB,
+ icon->tab = g_object_new (ADW_TAB_LIST_BASE_GET_CLASS (self)->item_type,
"view", priv->view,
"pinned", FALSE,
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]