[libadwaita/wip/chergert/type-ensure-from-class-init: 2/2] view-switcher: ensure types from class init




commit 0a2ae94384b8aa0b59936dbf7cdf6473e58634f1
Author: Christian Hergert <chergert redhat com>
Date:   Sun Dec 19 14:49:31 2021 -0800

    view-switcher: ensure types from class init
    
    These only need to be run once from class init.

 src/adw-view-switcher-button.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-view-switcher-button.c b/src/adw-view-switcher-button.c
index 434d8787..ed10d076 100644
--- a/src/adw-view-switcher-button.c
+++ b/src/adw-view-switcher-button.c
@@ -344,6 +344,8 @@ adw_view_switcher_button_class_init (AdwViewSwitcherButtonClass *klass)
   gtk_widget_class_bind_template_callback (widget_class, get_badge_text);
 
   gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_TAB);
+
+  g_type_ensure (ADW_TYPE_INDICATOR_BIN);
 }
 
 static void
@@ -353,8 +355,6 @@ adw_view_switcher_button_init (AdwViewSwitcherButton *self)
 
   self->icon_name = g_strdup ("image-missing");
 
-  g_type_ensure (ADW_TYPE_INDICATOR_BIN);
-
   gtk_widget_init_template (GTK_WIDGET (self));
 
   gtk_stack_set_visible_child (GTK_STACK (self->stack), GTK_WIDGET (self->horizontal_box));


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