From 9e641600c3ce69a9bf58bb7d9d9f3570775c0e59 Mon Sep 17 00:00:00 2001 From: Michael Gratton Date: Sat, 10 Apr 2021 21:23:39 +1000 Subject: [PATCH] client: Convert to using HdySqueezer for managing main toolbar actions --- .../application/application-main-window.vala | 6 ++++-- .../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 d47a1569..d124c583 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 1edf9d4f..98a62730 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 00104224..f593803b 100644 --- a/ui/components-main-toolbar.ui +++ b/ui/components-main-toolbar.ui @@ -168,10 +168,22 @@ - + True - True - True + + + True + True + True + + + + + True + True + False + +