[geary/mjog/1193-conversation-buttons-resize-race: 1/13] client: Convert to using HdySqueezer for managing main toolbar actions




commit 9e641600c3ce69a9bf58bb7d9d9f3570775c0e59
Author: Michael Gratton <mike vee net>
Date:   Sat Apr 10 21:23:39 2021 +1000

    client: Convert to using HdySqueezer for managing main toolbar actions

 src/client/application/application-main-window.vala |  6 ++++--
 src/client/components/components-main-toolbar.vala  |  3 ++-
 ui/components-main-toolbar.ui                       | 18 +++++++++++++++---
 3 files changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/src/client/application/application-main-window.vala 
b/src/client/application/application-main-window.vala
index d47a15690..d124c583d 100644
--- a/src/client/application/application-main-window.vala
+++ b/src/client/application/application-main-window.vala
@@ -1527,7 +1527,8 @@ public class Application.MainWindow :
         this.conversation_list_view.select_conversations(to_select);
 
         this.conversation_list_actions.selected_conversations = to_select.size;
-        this.main_toolbar.conversation_actions.selected_conversations = to_select.size;
+        this.main_toolbar.full_actions.selected_conversations = to_select.size;
+        this.main_toolbar.compact_actions.selected_conversations = to_select.size;
 
         if (this.selected_folder != null && !this.has_composer) {
             switch(to_select.size) {
@@ -1780,7 +1781,8 @@ public class Application.MainWindow :
             this.selected_folder_supports_trash
         );
         this.conversation_list_actions.update_trash_button(show_trash);
-        this.main_toolbar.conversation_actions.update_trash_button(show_trash);
+        this.main_toolbar.full_actions.update_trash_button(show_trash);
+        this.main_toolbar.compact_actions.update_trash_button(show_trash);
     }
 
     private async void update_context_dependent_actions(bool sensitive) {
diff --git a/src/client/components/components-main-toolbar.vala 
b/src/client/components/components-main-toolbar.vala
index 1edf9d4f5..98a62730a 100644
--- a/src/client/components/components-main-toolbar.vala
+++ b/src/client/components/components-main-toolbar.vala
@@ -25,7 +25,8 @@ public class Components.MainToolbar : Hdy.Leaflet {
 
     public bool find_open { get; set; default = false; }
 
-    [GtkChild] public unowned ConversationActions conversation_actions;
+    [GtkChild] public unowned ConversationActions full_actions;
+    [GtkChild] public unowned ConversationActions compact_actions;
 
     [GtkChild] private unowned Hdy.Leaflet conversations_leaflet;
 
diff --git a/ui/components-main-toolbar.ui b/ui/components-main-toolbar.ui
index 00104224a..f593803bd 100644
--- a/ui/components-main-toolbar.ui
+++ b/ui/components-main-toolbar.ui
@@ -168,10 +168,22 @@
           </object>
         </child>
         <child>
-          <object class="ComponentsConversationActions" id="conversation_actions">
+          <object class="HdySqueezer">
             <property name="visible">True</property>
-            <property name="show_conversation_actions">True</property>
-            <property name="show_response_actions">True</property>
+            <child>
+              <object class="ComponentsConversationActions" id="full_actions">
+                <property name="visible">True</property>
+                <property name="show_conversation_actions">True</property>
+                <property name="show_response_actions">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="ComponentsConversationActions" id="compact_actions">
+                <property name="visible">True</property>
+                <property name="show_conversation_actions">True</property>
+                <property name="show_response_actions">False</property>
+              </object>
+            </child>
           </object>
         </child>
         <child>


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