[nautilus/wip/antoniof/gnome-42: 27/72] Revert "toolbar: Don't rely on ::toggled in GtkMenuButton"




commit aab6a5a787f9c31bc35f84d31a0363ad01cb5ec3
Author: António Fernandes <antoniof gnome org>
Date:   Fri Feb 11 19:01:42 2022 +0000

    Revert "toolbar: Don't rely on ::toggled in GtkMenuButton"
    
    This reverts commit 2413531c76b796185c9ff6f835f49459bf0edfcd.

 src/nautilus-toolbar.c               | 9 ++++-----
 src/resources/ui/nautilus-toolbar.ui | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index c6f03517c..7148427ac 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -650,11 +650,10 @@ on_operations_icon_draw (GtkWidget       *widget,
 }
 
 static void
-on_operations_popover_notify_visible (NautilusToolbar *self,
-                                      GParamSpec      *pspec,
-                                      GObject         *popover)
+on_operations_button_toggled (NautilusToolbar *self,
+                              GtkToggleButton *button)
 {
-    if (gtk_widget_get_visible (GTK_WIDGET (popover)))
+    if (gtk_toggle_button_get_active (button))
     {
         unschedule_remove_finished_operations (self);
         nautilus_progress_manager_add_viewer (self->progress_manager,
@@ -1143,7 +1142,7 @@ nautilus_toolbar_class_init (NautilusToolbarClass *klass)
     gtk_widget_class_bind_template_child (widget_class, NautilusToolbar, search_button);
 
     gtk_widget_class_bind_template_callback (widget_class, on_operations_icon_draw);
-    gtk_widget_class_bind_template_callback (widget_class, on_operations_popover_notify_visible);
+    gtk_widget_class_bind_template_callback (widget_class, on_operations_button_toggled);
 }
 
 GtkWidget *
diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui
index c1d12eefe..8bb25bf2e 100644
--- a/src/resources/ui/nautilus-toolbar.ui
+++ b/src/resources/ui/nautilus-toolbar.ui
@@ -134,7 +134,6 @@
         </child>
       </object>
     </child>
-    <signal name="notify::visible" handler="on_operations_popover_notify_visible" object="NautilusToolbar" 
swapped="yes"/>
   </object>
   <template class="NautilusToolbar" parent="GtkBin">
     <property name="visible">True</property>
@@ -296,6 +295,7 @@
                     <property name="tooltip_text" translatable="yes">Show operations</property>
                     <property name="margin_end">6</property>
                     <property name="popover">operations_popover</property>
+                    <signal name="toggled" handler="on_operations_button_toggled" object="NautilusToolbar" 
swapped="yes"/>
                     <child>
                       <object class="GtkDrawingArea" id="operations_icon">
                         <property name="width_request">16</property>


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