[libadwaita] view-switcher-button: Stop removing needs-attention when active



commit 3063e2b1f51ba7f43952b7584bfbf3b29845762c
Author: CodedOre <CodedOre>
Date:   Mon Jun 28 17:38:18 2021 +0500

    view-switcher-button: Stop removing needs-attention when active
    
    This behavior makes no sense with badges, and apps can easily reimplement
    it if needed.

 src/adw-view-switcher-button.c  |  9 ---------
 src/adw-view-switcher-button.ui | 10 ++--------
 2 files changed, 2 insertions(+), 17 deletions(-)
---
diff --git a/src/adw-view-switcher-button.c b/src/adw-view-switcher-button.c
index 3be0bbe8..11e3c3f4 100644
--- a/src/adw-view-switcher-button.c
+++ b/src/adw-view-switcher-button.c
@@ -122,14 +122,6 @@ set_orientation (AdwViewSwitcherButton *self,
                                              self->horizontal_box));
 }
 
-static bool
-should_show_indicator (AdwViewSwitcherButton *self,
-                       gboolean               needs_attention,
-                       gboolean               active)
-{
-  return needs_attention && !active;
-}
-
 static gchar *
 get_badge_text (AdwViewSwitcherButton *self,
                 guint                  badge_number)
@@ -316,7 +308,6 @@ adw_view_switcher_button_class_init (AdwViewSwitcherButtonClass *klass)
   gtk_widget_class_bind_template_callback (widget_class, active_changed_cb);
   gtk_widget_class_bind_template_callback (widget_class, drag_enter_cb);
   gtk_widget_class_bind_template_callback (widget_class, drag_leave_cb);
-  gtk_widget_class_bind_template_callback (widget_class, should_show_indicator);
   gtk_widget_class_bind_template_callback (widget_class, get_badge_text);
 
   gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_TAB);
diff --git a/src/adw-view-switcher-button.ui b/src/adw-view-switcher-button.ui
index 4e783b44..1e9d4ad8 100644
--- a/src/adw-view-switcher-button.ui
+++ b/src/adw-view-switcher-button.ui
@@ -29,10 +29,7 @@
                   </closure>
                 </binding>
                 <binding name="needs-attention">
-                  <closure type="gboolean" function="should_show_indicator">
-                    <lookup name="needs-attention">AdwViewSwitcherButton</lookup>
-                    <lookup name="active">AdwViewSwitcherButton</lookup>
-                  </closure>
+                  <lookup name="needs-attention">AdwViewSwitcherButton</lookup>
                 </binding>
                 <property name="child">
                   <object class="GtkImage" id="horizontal_image">
@@ -81,10 +78,7 @@
                   </closure>
                 </binding>
                 <binding name="needs-attention">
-                  <closure type="gboolean" function="should_show_indicator">
-                    <lookup name="needs-attention">AdwViewSwitcherButton</lookup>
-                    <lookup name="active">AdwViewSwitcherButton</lookup>
-                  </closure>
+                  <lookup name="needs-attention">AdwViewSwitcherButton</lookup>
                 </binding>
                 <property name="child">
                   <object class="GtkImage" id="vertical_image">


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