[geary/gnumdk/stable] components: Rework adapative layout by removing HdySwipeGroup




commit 3b030ba68aaabdddef660fe2d7595af869d69b6e
Author: Cédric Bellegarde <cedric bellegarde adishatz org>
Date:   Wed Jul 20 08:11:45 2022 +0200

    components: Rework adapative layout by removing HdySwipeGroup
    
    HdySwipeGroup is deprecated since libhandy 1.4.
    
    - Split headerbar into 3 components
    - Remove HdySwipeGroups/GtkSizeGroups used for syncing headerbar with content.

 .../application/application-main-window.vala       |  81 +++----
 .../components-conversation-actions.vala           |   2 +-
 .../components-headerbar-application.vala          |  33 +++
 .../components-headerbar-conversation-list.vala    |  37 ++++
 .../components-headerbar-conversation.vala         |  59 ++++++
 src/client/components/components-main-toolbar.vala | 131 ------------
 src/client/composer/composer-box.vala              |  10 +-
 .../conversation-viewer/conversation-viewer.vala   |   2 +-
 src/client/meson.build                             |   4 +-
 ui/application-main-window.ui                      |  45 ++--
 ui/components-headerbar-application.ui             |  27 +++
 ui/components-headerbar-conversation-list.ui       |  67 ++++++
 ui/components-headerbar-conversation.ui            |  76 +++++++
 ui/components-main-toolbar.ui                      | 235 ---------------------
 ...bar-menus.ui => components-menu-application.ui} |  24 +--
 ui/components-menu-conversation.ui                 |  25 +++
 ui/org.gnome.Geary.gresource.xml                   |   7 +-
 17 files changed, 404 insertions(+), 461 deletions(-)
---
diff --git a/src/client/application/application-main-window.vala 
b/src/client/application/application-main-window.vala
index b70632867..49c5dfac2 100644
--- a/src/client/application/application-main-window.vala
+++ b/src/client/application/application-main-window.vala
@@ -353,7 +353,6 @@ public class Application.MainWindow :
 
     // Widget descendants
     public FolderList.Tree folder_list { get; private set; default = new FolderList.Tree(); }
-    public Components.MainToolbar main_toolbar { get; private set; }
     public SearchBar search_bar { get; private set; }
     public ConversationListView conversation_list_view  { get; private set; }
     public ConversationViewer conversation_viewer { get; private set; }
@@ -388,8 +387,9 @@ public class Application.MainWindow :
     private Geary.TimeoutManager update_ui_timeout;
     private int64 update_ui_last = 0;
 
-
-    [GtkChild] private unowned Gtk.Box main_layout;
+    [GtkChild] private unowned Components.ApplicationHeaderBar application_headerbar;
+    [GtkChild] private unowned Components.ConversationListHeaderBar conversation_list_headerbar;
+    [GtkChild] public unowned Components.ConversationHeaderBar conversation_headerbar;
 
     // Folds the inner leaftlet and conversation viewer
     [GtkChild] private unowned Hdy.Leaflet outer_leaflet;
@@ -407,28 +407,17 @@ public class Application.MainWindow :
 
     [GtkChild] private unowned Gtk.Box conversation_viewer_box;
     [GtkChild] private unowned Gtk.Revealer conversation_viewer_actions_revealer;
-    [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;
-    [GtkChild] private unowned Gtk.SizeGroup conversations_separator_size_group;
-    [GtkChild] private unowned Gtk.SizeGroup conversation_size_group;
-    [GtkChild] private unowned Hdy.SwipeGroup conversations_swipe_group;
-    [GtkChild] private unowned Hdy.SwipeGroup conversation_swipe_group;
 
     [GtkChild] private unowned Gtk.Overlay overlay;
 
+    [GtkChild] private unowned Components.InfoBarStack info_bars;
+
     private Components.ConversationActions[] folder_conversation_actions = {};
     private FolderPopover[] folder_popovers = {};
 
-    private Components.InfoBarStack info_bars =
-        new Components.InfoBarStack(SINGLE);
-
     private Components.InfoBar offline_infobar;
-
     private Components.InfoBar cert_problem_infobar;
-
     private Components.InfoBar auth_problem_infobar;
-
     private Components.ProblemReportInfoBar? service_problem_infobar = null;
 
     /** Fired when the user requests an account status be retried. */
@@ -708,8 +697,8 @@ public class Application.MainWindow :
             title = _("%s — %s").printf(folder_name, account_name);
         }
         this.title = title;
-        this.main_toolbar.account = account_name ?? "";
-        this.main_toolbar.folder = folder_name?? "";
+        this.conversation_list_headerbar.account = account_name ?? "";
+        this.conversation_list_headerbar.folder = folder_name?? "";
     }
 
     /** Updates the window's account status info bars. */
@@ -947,7 +936,7 @@ public class Application.MainWindow :
         if (this.inner_leaflet.folded) {
             this.inner_leaflet.navigate(Hdy.NavigationDirection.BACK);
         }
-        this.main_toolbar.show_main_menu();
+        this.application_headerbar.show_app_menu();
     }
 
     /** Displays and focuses the search bar for the window. */
@@ -1360,41 +1349,24 @@ public class Application.MainWindow :
         this.conversation_viewer.hexpand = true;
         this.conversation_viewer_box.add(this.conversation_viewer);
 
-        // Main toolbar
-        this.main_toolbar = new Components.MainToolbar(config);
-        this.main_toolbar.add_to_size_groups(this.folder_size_group,
-                                             this.folder_separator_size_group,
-                                             this.conversations_size_group,
-                                             this.conversations_separator_size_group,
-                                             this.conversation_size_group);
-        this.main_toolbar.add_to_swipe_groups(this.conversations_swipe_group,
-                                              this.conversation_swipe_group);
-        this.main_toolbar.bind_property(
+        this.conversation_list_headerbar.bind_property(
             "search-open",
             this.search_bar, "search-mode-enabled",
             SYNC_CREATE | BIDIRECTIONAL
         );
-        this.main_toolbar.bind_property(
+        this.conversation_headerbar.bind_property(
             "find-open",
             this.conversation_viewer.conversation_find_bar, "search-mode-enabled",
             SYNC_CREATE | BIDIRECTIONAL
         );
-        this.main_toolbar.notify["shown-actions"].connect(
+        this.conversation_list_headerbar.notify["shown-actions"].connect(
             () => {
                 this.conversation_viewer_actions_revealer.reveal_child = (
-                    this.main_toolbar.shown_actions ==
-                    this.main_toolbar.compact_actions
+                    this.conversation_headerbar.shown_actions ==
+                    this.conversation_headerbar.compact_actions
                 );
             }
         );
-        if (config.desktop_environment == UNITY) {
-            this.main_toolbar.show_close_button = false;
-            this.main_layout.pack_start(main_toolbar, false, true, 0);
-        } else {
-            this.main_layout.pack_start(main_toolbar, false, true, 0);
-        }
-
-        this.main_layout.pack_start(this.info_bars, false, true, 0);
 
         // Status bar
         this.status_bar.set_size_request(-1, STATUS_BAR_HEIGHT);
@@ -1405,7 +1377,8 @@ public class Application.MainWindow :
         this.status_bar.show_all();
 
         this.folder_conversation_actions = {
-            this.main_toolbar.full_actions,
+            this.conversation_headerbar.full_actions,
+            this.conversation_headerbar.compact_actions,
             this.conversation_list_actions
         };
         foreach (var actions in this.folder_conversation_actions) {
@@ -1629,8 +1602,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.full_actions.selected_conversations = to_select.size;
-        this.main_toolbar.compact_actions.selected_conversations = to_select.size;
+        this.conversation_headerbar.full_actions.selected_conversations = to_select.size;
+        this.conversation_headerbar.compact_actions.selected_conversations = to_select.size;
 
         if (this.selected_folder != null && !this.has_composer) {
             switch(to_select.size) {
@@ -1817,8 +1790,8 @@ public class Application.MainWindow :
             }
 
             if (count > 0) {
-                this.main_toolbar.folder = _("%s (%d)").printf(
-                    this.main_toolbar.folder, count
+                this.conversation_list_headerbar.folder = _("%s (%d)").printf(
+                    this.conversation_list_headerbar.folder, count
                 );
             }
         }
@@ -1890,7 +1863,8 @@ public class Application.MainWindow :
             this.selected_folder_supports_trash
         );
         this.conversation_list_actions.update_trash_button(show_trash);
-        this.main_toolbar.full_actions.update_trash_button(show_trash);
+        this.conversation_headerbar.full_actions.update_trash_button(show_trash);
+        this.conversation_headerbar.compact_actions.update_trash_button(show_trash);
     }
 
     private async void update_context_dependent_actions(bool sensitive) {
@@ -2123,12 +2097,15 @@ public class Application.MainWindow :
             ConversationCount.for_size(selected)
         );
         if (this.outer_leaflet.folded) {
+            this.conversation_list_headerbar.show_close_button = true;
             // Ensure something useful gets the keyboard focus, given
             // GNOME/libhandy#179
             if (this.is_conversation_list_shown) {
                 this.conversation_list_view.grab_focus();
             } else if (this.is_folder_list_shown) {
                 this.folder_list.grab_focus();
+            } else {
+                this.conversation_headerbar.back_button.visible = true;
             }
 
             // Close any open composer that is no longer visible
@@ -2136,19 +2113,27 @@ public class Application.MainWindow :
                 (this.is_folder_list_shown || this.is_conversation_list_shown)) {
                 close_composer(false, false);
             }
+        } else {
+            this.conversation_list_headerbar.show_close_button = false;
+            this.conversation_headerbar.back_button.visible = false;
         }
     }
 
     [GtkCallback]
     private void on_inner_leaflet_changed() {
         if (this.inner_leaflet.folded) {
+            this.application_headerbar.show_close_button = true;
             // Ensure something useful gets the keyboard focus, given
             // GNOME/libhandy#179
             if (this.is_conversation_list_shown) {
+                this.conversation_list_headerbar.back_button.visible = true;
                 this.conversation_list_view.grab_focus();
             } else if (this.is_folder_list_shown) {
                 this.folder_list.grab_focus();
             }
+        } else {
+            this.application_headerbar.show_close_button = false;
+            this.conversation_list_headerbar.back_button.visible = false;
         }
     }
 
@@ -2430,7 +2415,7 @@ public class Application.MainWindow :
             this.conversation_list_actions_revealer.child_revealed) {
             this.conversation_list_actions.show_move_menu();
         } else if (this.is_conversation_viewer_shown) {
-            this.main_toolbar.shown_actions.show_move_menu();
+            this.conversation_headerbar.shown_actions.show_move_menu();
         } else {
             error_bell();
         }
diff --git a/src/client/components/components-conversation-actions.vala 
b/src/client/components/components-conversation-actions.vala
index e4c9df78d..7ef4c6578 100644
--- a/src/client/components/components-conversation-actions.vala
+++ b/src/client/components/components-conversation-actions.vala
@@ -46,7 +46,7 @@ public class Components.ConversationActions : Gtk.Box {
     construct {
         // Assemble the mark menus
         Gtk.Builder menu_builder = new Gtk.Builder.from_resource(
-            "/org/gnome/Geary/components-main-toolbar-menus.ui"
+            "/org/gnome/Geary/components-menu-conversation.ui"
         );
         GLib.MenuModel mark_menu = (MenuModel) menu_builder.get_object(
             "mark_message_menu"
diff --git a/src/client/components/components-headerbar-application.vala 
b/src/client/components/components-headerbar-application.vala
new file mode 100644
index 000000000..39ca1312c
--- /dev/null
+++ b/src/client/components/components-headerbar-application.vala
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2017 Software Freedom Conservancy Inc.
+ * Copyright © 2021 Michael Gratton <mike vee net>
+ * Copyright © 2022 Cédric Bellegarde <cedric bellegarde adishatz org>
+ *
+ * This software is licensed under the GNU Lesser General Public License
+ * (version 2.1 or later). See the COPYING file in this distribution.
+ */
+
+
+/**
+ * The Application HeaderBar
+ *
+ * @see Application.MainWindow
+ */
+[GtkTemplate (ui = "/org/gnome/Geary/components-headerbar-application.ui")]
+public class Components.ApplicationHeaderBar : Hdy.HeaderBar {
+
+    [GtkChild] private unowned Gtk.MenuButton app_menu_button;
+
+
+    construct {
+        Gtk.Builder builder = new 
Gtk.Builder.from_resource("/org/gnome/Geary/components-menu-application.ui");
+        MenuModel app_menu = (MenuModel) builder.get_object("app_menu");
+
+        this.app_menu_button.popover = new Gtk.Popover.from_model(null, app_menu);
+    }
+
+    public void show_app_menu() {
+        this.app_menu_button.clicked();
+    }
+
+}
diff --git a/src/client/components/components-headerbar-conversation-list.vala 
b/src/client/components/components-headerbar-conversation-list.vala
new file mode 100644
index 000000000..319b2a4ef
--- /dev/null
+++ b/src/client/components/components-headerbar-conversation-list.vala
@@ -0,0 +1,37 @@
+/*
+ * Copyright © 2017 Software Freedom Conservancy Inc.
+ * Copyright © 2021 Michael Gratton <mike vee net>
+ * Copyright © 2022 Cédric Bellegarde <cedric bellegarde adishatz org>
+ *
+ * This software is licensed under the GNU Lesser General Public License
+ * (version 2.1 or later). See the COPYING file in this distribution.
+ */
+
+
+/**
+ * The conversation list headerbar.
+ *
+ * @see Application.MainWindow
+ */
+[GtkTemplate (ui = "/org/gnome/Geary/components-headerbar-conversation-list.ui")]
+public class Components.ConversationListHeaderBar : Hdy.HeaderBar {
+
+    public string account { get; set; }
+    public string folder { get; set; }
+    public bool search_open { get; set; default = false; }
+
+    [GtkChild] private unowned Gtk.ToggleButton search_button;
+    [GtkChild] public unowned Gtk.Button back_button;
+
+
+    construct {
+        this.bind_property("account", this, "title", BindingFlags.SYNC_CREATE);
+        this.bind_property("folder", this, "subtitle", BindingFlags.SYNC_CREATE);
+
+        this.bind_property(
+            "search-open",
+            this.search_button, "active",
+            SYNC_CREATE | BIDIRECTIONAL
+        );
+    }
+}
diff --git a/src/client/components/components-headerbar-conversation.vala 
b/src/client/components/components-headerbar-conversation.vala
new file mode 100644
index 000000000..6179f0311
--- /dev/null
+++ b/src/client/components/components-headerbar-conversation.vala
@@ -0,0 +1,59 @@
+/*
+ * Copyright © 2017 Software Freedom Conservancy Inc.
+ * Copyright © 2021 Michael Gratton <mike vee net>
+ * Copyright © 2022 Cédric Bellegarde <cedric bellegarde adishatz org>
+ *
+ * This software is licensed under the GNU Lesser General Public License
+ * (version 2.1 or later). See the COPYING file in this distribution.
+ */
+
+
+/**
+ * The conversations headerbar.
+ *
+ * @see Application.MainWindow
+ */
+[GtkTemplate (ui = "/org/gnome/Geary/components-headerbar-conversation.ui")]
+public class Components.ConversationHeaderBar : Gtk.Bin {
+
+    public bool find_open { get; set; default = false; }
+
+    public ConversationActions shown_actions {
+        get {
+            return (ConversationActions) this.actions_squeezer.visible_child;
+        }
+    }
+
+    [GtkChild] private unowned Hdy.Squeezer actions_squeezer;
+    [GtkChild] public unowned ConversationActions full_actions;
+    [GtkChild] public unowned ConversationActions compact_actions;
+
+    [GtkChild] private unowned Gtk.ToggleButton find_button;
+    [GtkChild] public unowned Gtk.Button back_button;
+
+    [GtkChild] private unowned Hdy.HeaderBar conversation_header;
+
+
+    construct {
+        this.actions_squeezer.notify["visible-child"].connect_after(
+            () => { notify_property("shown-actions"); }
+        );
+
+        this.bind_property(
+            "find-open",
+            this.find_button, "active",
+            SYNC_CREATE | BIDIRECTIONAL
+        );
+    }
+
+    public void set_conversation_header(Hdy.HeaderBar header) {
+        remove(this.conversation_header);
+        header.hexpand = true;
+        add(header);
+    }
+
+    public void remove_conversation_header(Hdy.HeaderBar header) {
+        remove(header);
+        add(this.conversation_header);
+    }
+}
diff --git a/src/client/composer/composer-box.vala b/src/client/composer/composer-box.vala
index 2addc0c13..dfe5a5ca8 100644
--- a/src/client/composer/composer-box.vala
+++ b/src/client/composer/composer-box.vala
@@ -27,19 +27,19 @@ public class Composer.Box : Gtk.Frame, Container {
     /** {@inheritDoc} */
     internal Widget composer { get; set; }
 
-    private Components.MainToolbar main_toolbar { get; private set; }
+    private Components.ConversationHeaderBar headerbar { get; private set; }
 
 
     /** Emitted when the container is closed. */
     public signal void vanished();
 
 
-    public Box(Widget composer, Components.MainToolbar main_toolbar) {
+    public Box(Widget composer, Components.ConversationHeaderBar headerbar) {
         this.composer = composer;
         this.composer.set_mode(PANED);
 
-        this.main_toolbar = main_toolbar;
-        this.main_toolbar.set_conversation_header(composer.header);
+        this.headerbar = headerbar;
+        this.headerbar.set_conversation_header(composer.header);
 
         get_style_context().add_class("geary-composer-box");
         this.halign = Gtk.Align.FILL;
@@ -54,7 +54,7 @@ public class Composer.Box : Gtk.Frame, Container {
     public void close() {
         vanished();
 
-        this.main_toolbar.remove_conversation_header(composer.header);
+        this.headerbar.remove_conversation_header(composer.header);
         remove(this.composer);
         destroy();
     }
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index e3a9825e8..983d6539e 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -150,7 +150,7 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
         var main_window = get_toplevel() as Application.MainWindow;
         if (main_window != null) {
             Composer.Box box = new Composer.Box(
-                composer, main_window.main_toolbar
+                composer, main_window.conversation_headerbar
             );
             this.current_composer = composer;
 
diff --git a/src/client/meson.build b/src/client/meson.build
index 35d5569a9..eeabedbb9 100644
--- a/src/client/meson.build
+++ b/src/client/meson.build
@@ -49,6 +49,9 @@ client_vala_sources = files(
   'components/components-attachment-pane.vala',
   'components/components-conversation-actions.vala',
   'components/components-entry-undo.vala',
+  'components/components-headerbar-application.vala',
+  'components/components-headerbar-conversation-list.vala',
+  'components/components-headerbar-conversation.vala',
   'components/components-info-bar-stack.vala',
   'components/components-info-bar.vala',
   'components/components-inspector.vala',
@@ -56,7 +59,6 @@ client_vala_sources = files(
   'components/components-inspector-error-view.vala',
   'components/components-inspector-log-view.vala',
   'components/components-inspector-system-view.vala',
-  'components/components-main-toolbar.vala',
   'components/components-placeholder-pane.vala',
   'components/components-preferences-window.vala',
   'components/components-problem-report-info-bar.vala',
diff --git a/ui/application-main-window.ui b/ui/application-main-window.ui
index dc841501f..36ae7a780 100644
--- a/ui/application-main-window.ui
+++ b/ui/application-main-window.ui
@@ -36,6 +36,14 @@
                       <object class="GtkBox" id="folder_box">
                         <property name="visible">True</property>
                         <property name="orientation">vertical</property>
+                        <child>
+                          <object class="ComponentsApplicationHeaderBar" id="application_headerbar">
+                            <property name="visible">True</property>
+                          </object>
+                          <packing>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
                         <child>
                           <object class="GtkFrame" id="folder_frame">
                             <property name="visible">True</property>
@@ -54,7 +62,7 @@
                           </object>
                           <packing>
                             <property name="fill">True</property>
-                            <property name="position">0</property>
+                            <property name="position">1</property>
                           </packing>
                         </child>
                       </object>
@@ -78,6 +86,14 @@
                       <object class="GtkBox" id="conversation_list_box">
                         <property name="visible">True</property>
                         <property name="orientation">vertical</property>
+                        <child>
+                          <object class="ComponentsConversationListHeaderBar" 
id="conversation_list_headerbar">
+                            <property name="visible">True</property>
+                          </object>
+                          <packing>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
                         <child>
                           <object class="GtkFrame" id="conversation_frame">
                             <property name="visible">True</property>
@@ -149,6 +165,14 @@
                     <property name="visible">True</property>
                     <property name="hexpand">True</property>
                     <property name="orientation">vertical</property>
+                    <child>
+                      <object class="ComponentsConversationHeaderBar" id="conversation_headerbar">
+                        <property name="visible">True</property>
+                      </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
                     <child>
                       <object class="GtkRevealer" id="conversation_viewer_actions_revealer">
                         <property name="visible">True</property>
@@ -175,12 +199,15 @@
               <packing>
                 <property name="expand">True</property>
                 <property name="fill">True</property>
-                <property name="pack_type">end</property>
-                <property name="position">0</property>
+                <property name="pack_type">start</property>
               </packing>
             </child>
             <child>
-              <placeholder/>
+              <object class="ComponentsInfoBarStack" id="info_bars">
+              </object>
+              <packing>
+                <property name="pack_type">end</property>
+              </packing>
             </child>
             <style>
               <class name="geary-main-layout"/>
@@ -232,14 +259,4 @@
       <widget name="conversation_viewer_box"/>
     </widgets>
   </object>
-  <object class="HdySwipeGroup" id="conversations_swipe_group">
-    <swipeables>
-      <swipeable name="inner_leaflet"/>
-    </swipeables>
-  </object>
-  <object class="HdySwipeGroup" id="conversation_swipe_group">
-    <swipeables>
-      <swipeable name="outer_leaflet"/>
-    </swipeables>
-  </object>
 </interface>
diff --git a/ui/components-headerbar-application.ui b/ui/components-headerbar-application.ui
new file mode 100644
index 000000000..96c621944
--- /dev/null
+++ b/ui/components-headerbar-application.ui
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface>
+  <requires lib="gtk+" version="3.20"/>
+  <template class="ComponentsApplicationHeaderBar" parent="HdyHeaderBar">
+    <property name="visible">True</property>
+    <property name="title">Mail</property>
+    <child>
+      <object class="GtkMenuButton" id="app_menu_button">
+        <property name="visible">True</property>
+        <property name="focus_on_click">False</property>
+        <property name="receives_default">False</property>
+        <property name="always_show_image">True</property>
+        <child>
+          <object class="GtkImage" id="main_menu_image">
+            <property name="visible">True</property>
+            <property name="icon_name">open-menu-symbolic</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="pack_type">end</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+  </template>
+</interface>
diff --git a/ui/components-headerbar-conversation-list.ui b/ui/components-headerbar-conversation-list.ui
new file mode 100644
index 000000000..9addaab67
--- /dev/null
+++ b/ui/components-headerbar-conversation-list.ui
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface>
+  <requires lib="gtk+" version="3.20"/>
+  <template class="ComponentsConversationListHeaderBar" parent="HdyHeaderBar">
+    <property name="visible">True</property>
+    <property name="hexpand">True</property>
+    <child>
+      <object class="GtkButton" id="back_button">
+        <property name="receives_default">False</property>
+        <property name="valign">center</property>
+        <property name="use-underline">True</property>
+        <property name="action_name">win.navigation-back</property>
+        <style>
+          <class name="image-button"/>
+        </style>
+        <child internal-child="accessible">
+          <object class="AtkObject" id="a11y-conversations-back">
+            <property name="accessible-name" translatable="yes">Back</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkImage" id="conversations_back_image">
+            <property name="visible">True</property>
+            <property name="icon_name">go-previous-symbolic</property>
+            <property name="icon_size">1</property>
+          </object>
+        </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkButton" id="compose_new_message_button">
+        <property name="visible">True</property>
+        <property name="focus_on_click">False</property>
+        <property name="receives_default">False</property>
+        <property name="tooltip_text" translatable="yes" context="tooltip">Compose Message</property>
+        <property name="action_name">app.compose</property>
+        <property name="always_show_image">True</property>
+        <child>
+          <object class="GtkImage" id="compose_new_message_image">
+            <property name="visible">True</property>
+            <property name="icon_name">mail-message-new-symbolic</property>
+          </object>
+        </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkToggleButton" id="search_button">
+        <property name="visible">True</property>
+        <property name="focus_on_click">False</property>
+        <property name="receives_default">False</property>
+        <property name="tooltip_text" translatable="yes">Toggle search bar</property>
+        <property name="always_show_image">True</property>
+        <child>
+          <object class="GtkImage" id="search_conversations_image">
+            <property name="visible">True</property>
+            <property name="icon_name">preferences-system-search-symbolic</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="pack_type">end</property>
+        <property name="position">3</property>
+      </packing>
+    </child>
+  </template>
+</interface>
diff --git a/ui/components-headerbar-conversation.ui b/ui/components-headerbar-conversation.ui
new file mode 100644
index 000000000..adfc946ac
--- /dev/null
+++ b/ui/components-headerbar-conversation.ui
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface>
+  <requires lib="gtk+" version="3.20"/>
+  <template class="ComponentsConversationHeaderBar" parent="GtkBin">
+    <child>
+      <object class="HdyHeaderBar" id="conversation_header">
+        <property name="visible">True</property>
+        <property name="hexpand">True</property>
+        <property name="show_close_button">True</property>
+        <child>
+          <object class="GtkButton" id="back_button">
+            <property name="receives_default">False</property>
+            <property name="valign">center</property>
+            <property name="use-underline">True</property>
+            <property name="action_name">win.navigation-back</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child internal-child="accessible">
+              <object class="AtkObject" id="a11y-conversation-back">
+                <property name="accessible-name" translatable="yes">Back</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkImage" id="conversation_back_image">
+                <property name="visible">True</property>
+                <property name="icon_name">go-previous-symbolic</property>
+                <property name="icon_size">1</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="title">
+          <object class="HdySqueezer" id="actions_squeezer">
+            <property name="visible">True</property>
+            <property name="hexpand">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">False</property>
+                <property name="show_response_actions">True</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkToggleButton" id="find_button">
+            <property name="visible">True</property>
+            <property name="focus_on_click">False</property>
+            <property name="receives_default">False</property>
+            <property name="tooltip_text" translatable="yes">Toggle find bar</property>
+            <property name="always_show_image">True</property>
+            <child>
+              <object class="GtkImage" id="find_image">
+                <property name="visible">True</property>
+                <property name="icon_name">preferences-system-search-symbolic</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>
diff --git a/ui/components-main-toolbar-menus.ui b/ui/components-menu-application.ui
similarity index 54%
rename from ui/components-main-toolbar-menus.ui
rename to ui/components-menu-application.ui
index ebbc72f04..8be1d7a3c 100644
--- a/ui/components-main-toolbar-menus.ui
+++ b/ui/components-menu-application.ui
@@ -1,28 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <menu id="mark_message_menu">
-    <item>
-      <attribute name="label" translatable="yes">Mark as _Read</attribute>
-      <attribute name="action">win.mark-conversation-read</attribute>
-    </item>
-    <item>
-      <attribute name="label" translatable="yes">Mark as _Unread</attribute>
-      <attribute name="action">win.mark-conversation-unread</attribute>
-    </item>
-    <item>
-      <attribute name="label" translatable="yes">_Star</attribute>
-      <attribute name="action">win.mark-conversation-starred</attribute>
-    </item>
-    <item>
-      <attribute name="label" translatable="yes">U_nstar</attribute>
-      <attribute name="action">win.mark-conversation-unstarred</attribute>
-    </item>
-    <item>
-      <attribute name="label" translatable="yes">Toggle as _Junk</attribute>
-      <attribute name="action">win.toggle-conversation-junk</attribute>
-    </item>
-  </menu>
-  <menu id="main_menu">
+  <menu id="app_menu">
     <section>
       <item>
         <attribute name="label" translatable="yes">_Accounts</attribute>
diff --git a/ui/components-menu-conversation.ui b/ui/components-menu-conversation.ui
new file mode 100644
index 000000000..6fcbc1772
--- /dev/null
+++ b/ui/components-menu-conversation.ui
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <menu id="mark_message_menu">
+    <item>
+      <attribute name="label" translatable="yes">Mark as _Read</attribute>
+      <attribute name="action">win.mark-conversation-read</attribute>
+    </item>
+    <item>
+      <attribute name="label" translatable="yes">Mark as _Unread</attribute>
+      <attribute name="action">win.mark-conversation-unread</attribute>
+    </item>
+    <item>
+      <attribute name="label" translatable="yes">_Star</attribute>
+      <attribute name="action">win.mark-conversation-starred</attribute>
+    </item>
+    <item>
+      <attribute name="label" translatable="yes">U_nstar</attribute>
+      <attribute name="action">win.mark-conversation-unstarred</attribute>
+    </item>
+    <item>
+      <attribute name="label" translatable="yes">Toggle as _Junk</attribute>
+      <attribute name="action">win.toggle-conversation-junk</attribute>
+    </item>
+  </menu>
+</interface>
diff --git a/ui/org.gnome.Geary.gresource.xml b/ui/org.gnome.Geary.gresource.xml
index 3af61ca76..a486d1fa8 100644
--- a/ui/org.gnome.Geary.gresource.xml
+++ b/ui/org.gnome.Geary.gresource.xml
@@ -13,14 +13,17 @@
     <file compressed="true" preprocess="xml-stripblanks">components-attachment-pane-menus.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">components-attachment-view.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">components-conversation-actions.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">components-headerbar-application.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">components-headerbar-conversation-list.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">components-headerbar-conversation.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">components-in-app-notification.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">components-info-bar.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">components-inspector.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">components-inspector-error-view.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">components-inspector-log-view.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">components-inspector-system-view.ui</file>
-    <file compressed="true" preprocess="xml-stripblanks">components-main-toolbar.ui</file>
-    <file compressed="true" preprocess="xml-stripblanks">components-main-toolbar-menus.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">components-menu-application.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">components-menu-conversation.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">components-placeholder-pane.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">composer-editor.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">composer-editor-menus.ui</file>


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