[geary/mjog/1193-conversation-buttons-resize-race: 8/13] Client: Only show conversation viewer's actions when needed




commit dfeeabe828b2a0c0f6698083836a22ab241d03d9
Author: Michael Gratton <mike vee net>
Date:   Sun Apr 11 12:28:32 2021 +1000

    Client: Only show conversation viewer's actions when needed
    
    The conversation viewer's actions are only needed when the main
    toolbar's compact actions are being shown.

 src/client/application/application-main-window.vala | 9 ++++++++-
 src/client/components/components-main-toolbar.vala  | 4 ++++
 2 files changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/src/client/application/application-main-window.vala 
b/src/client/application/application-main-window.vala
index ef5eeea8d..3af251db7 100644
--- a/src/client/application/application-main-window.vala
+++ b/src/client/application/application-main-window.vala
@@ -410,7 +410,6 @@ public class Application.MainWindow :
 
     [GtkChild] private unowned Gtk.Box conversation_viewer_box;
     [GtkChild] private unowned Gtk.Revealer conversation_viewer_actions_revealer;
-    [GtkChild] private unowned Components.ConversationActions conversation_viewer_actions;
     [GtkChild] private unowned Gtk.SizeGroup folder_size_group;
     [GtkChild] private unowned Gtk.SizeGroup folder_separator_size_group;
     [GtkChild] private unowned Gtk.SizeGroup conversations_size_group;
@@ -1369,6 +1368,14 @@ public class Application.MainWindow :
             this.conversation_viewer.conversation_find_bar, "search-mode-enabled",
             SYNC_CREATE | BIDIRECTIONAL
         );
+        this.main_toolbar.notify["shown-actions"].connect(
+            () => {
+                this.conversation_viewer_actions_revealer.reveal_child = (
+                    this.main_toolbar.shown_actions ==
+                    this.main_toolbar.compact_actions
+                );
+            }
+        );
         if (config.desktop_environment == UNITY) {
             this.main_toolbar.show_close_button = false;
             this.main_layout.pack_start(main_toolbar, false, true, 0);
diff --git a/src/client/components/components-main-toolbar.vala 
b/src/client/components/components-main-toolbar.vala
index 90e6f79d6..a66e98885 100644
--- a/src/client/components/components-main-toolbar.vala
+++ b/src/client/components/components-main-toolbar.vala
@@ -80,6 +80,10 @@ public class Components.MainToolbar : Hdy.Leaflet {
             this.find_button, "active",
             SYNC_CREATE | BIDIRECTIONAL
         );
+
+        this.actions_squeezer.notify["visible-child"].connect_after(
+            () => { notify_property("shown-actions"); }
+        );
     }
 
     public void set_conversation_header(Hdy.HeaderBar header) {


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