From 28a19775b8689f08c4e6c280e9414547d23d42c7 Mon Sep 17 00:00:00 2001
From: Julian Sparber <julian@sparber.net>
Date: Wed, 30 Sep 2020 17:38:24 +0200
Subject: [PATCH 055/124] main-toolbar: Add back buttons for leaflet navigation

---
 .../application/application-main-window.vala  |  2 +
 ui/main-toolbar.ui                            | 52 +++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/src/client/application/application-main-window.vala b/src/client/application/application-main-window.vala
index bb5a9404..c3cf2d58 100644
--- a/src/client/application/application-main-window.vala
+++ b/src/client/application/application-main-window.vala
@@ -31,6 +31,7 @@ public class Application.MainWindow :
     public const string ACTION_TOGGLE_JUNK = "toggle-conversation-junk";
     public const string ACTION_TRASH_CONVERSATION = "trash-conversation";
     public const string ACTION_ZOOM = "zoom";
+    public const string ACTION_NAVIGATION_BACK = "navigation-back";
 
     private const ActionEntry[] EDIT_ACTIONS = {
         { Action.Edit.UNDO, on_undo },
@@ -42,6 +43,7 @@ public class Application.MainWindow :
 
         { ACTION_FIND_IN_CONVERSATION, on_find_in_conversation_action },
         { ACTION_SEARCH, on_search_activated },
+        { ACTION_NAVIGATION_BACK, focus_previous_pane},
         // Message actions
         { ACTION_REPLY_CONVERSATION, on_reply_conversation },
         { ACTION_REPLY_ALL_CONVERSATION, on_reply_all_conversation },
diff --git a/ui/main-toolbar.ui b/ui/main-toolbar.ui
index 441cd146..871aba25 100644
--- a/ui/main-toolbar.ui
+++ b/ui/main-toolbar.ui
@@ -69,6 +69,32 @@
             <property name="can_focus">False</property>
             <property name="hexpand">True</property>
             <property name="show_close_button" bind-source="MainToolbar" bind-property="show_close_button" bind-flags="sync-create"/>
+            <child>
+              <object class="GtkButton" id="conversations_back">
+                <property name="can_focus">False</property>
+                <property name="receives_default">False</property>
+                <property name="valign">center</property>
+                <property name="use-underline">True</property>
+                <property name="visible" bind-source="conversations_leaflet" bind-property="folded" bind-flags="sync-create"/>
+                <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="can_focus">False</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>
@@ -137,6 +163,32 @@
         <property name="can_focus">False</property>
         <property name="hexpand">True</property>
         <property name="show_close_button" bind-source="MainToolbar" bind-property="show_close_button" bind-flags="sync-create"/>
+        <child>
+          <object class="GtkButton" id="conversation_back">
+            <property name="can_focus">False</property>
+            <property name="receives_default">False</property>
+            <property name="valign">center</property>
+            <property name="use-underline">True</property>
+            <property name="visible" bind-source="MainToolbar" bind-property="folded" bind-flags="sync-create"/>
+            <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="can_focus">False</property>
+                <property name="icon_name">go-previous-symbolic</property>
+                <property name="icon_size">1</property>
+              </object>
+            </child>
+          </object>
+        </child>
         <child>
           <object class="GtkBox" id="reply_forward_buttons">
             <property name="visible">True</property>
-- 
2.29.2

