From 12a7101ba55bb646161e9997485036744121f542 Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Thu, 24 Oct 2019 14:36:04 +0200 Subject: [PATCH 051/124] Use leaflets in the UI There is no way to navigate into the app, but it's a start. v2: replace expand with child vexpand --- .../application/application-main-window.vala | 8 +-- src/client/components/main-toolbar.vala | 5 +- .../conversation-viewer.vala | 4 ++ ui/application-main-window.ui | 52 ++++++++++++++----- ui/geary.css | 11 ++++ ui/main-toolbar.ui | 33 +++++++----- 6 files changed, 81 insertions(+), 32 deletions(-) diff --git a/src/client/application/application-main-window.vala b/src/client/application/application-main-window.vala index 4c6d1038..b56079cf 100644 --- a/src/client/application/application-main-window.vala +++ b/src/client/application/application-main-window.vala @@ -317,9 +317,9 @@ public class Application.MainWindow : [GtkChild] private Gtk.Box main_layout; [GtkChild] - private Gtk.Paned folder_paned; + private Hdy.Leaflet main_leaflet; [GtkChild] - private Gtk.Paned conversations_paned; + private Hdy.Leaflet conversations_leaflet; [GtkChild] private Gtk.Box folder_box; [GtkChild] @@ -520,7 +520,6 @@ public class Application.MainWindow : }); setup_layout(application.config); - this.folder_paned.orientation = Gtk.Orientation.HORIZONTAL; this.folder_box.pack_start(status_bar, false, false); update_command_actions(); @@ -1249,8 +1248,9 @@ public class Application.MainWindow : on_conversation_view_added ); - this.conversations_paned.pack2(this.conversation_viewer, true, false); + this.conversation_viewer.hexpand = true; this.conversation_size_group.add_widget(this.conversation_viewer); + this.main_leaflet.add_with_properties(this.conversation_viewer, "name", "conversation", null); // Main toolbar this.main_toolbar = new MainToolbar(config); diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala index 6ea472a8..286546d5 100644 --- a/src/client/components/main-toolbar.vala +++ b/src/client/components/main-toolbar.vala @@ -6,7 +6,7 @@ // Draws the main toolbar. [GtkTemplate (ui = "/org/gnome/Geary/main-toolbar.ui")] -public class MainToolbar : Gtk.Box { +public class MainToolbar : Hdy.Leaflet { // How wide the left pane should be. Auto-synced with our settings public int left_pane_width { get; set; } // Used to form the title of the folder header @@ -97,7 +97,8 @@ public class MainToolbar : Gtk.Box { public void set_conversation_header(Gtk.HeaderBar header) { conversation_header.hide(); this.header_group.add_gtk_header_bar(header); - pack_start(header, true, true); + header.hexpand = true; + add(header); } public void remove_conversation_header(Gtk.HeaderBar header) { diff --git a/src/client/conversation-viewer/conversation-viewer.vala b/src/client/conversation-viewer/conversation-viewer.vala index f04a1d26..eec5f6a4 100644 --- a/src/client/conversation-viewer/conversation-viewer.vala +++ b/src/client/conversation-viewer/conversation-viewer.vala @@ -68,6 +68,10 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface { public signal void conversation_removed(ConversationListBox list); + static construct { + set_css_name("geary-conversation-viewer"); + } + /** * Constructs a new conversation view instance. */ diff --git a/ui/application-main-window.ui b/ui/application-main-window.ui index 872f31bd..f7bb884e 100644 --- a/ui/application-main-window.ui +++ b/ui/application-main-window.ui @@ -24,13 +24,18 @@ False vertical - + True True + True + over - + True True + True + True + over True @@ -40,6 +45,7 @@ True False + True 0 in @@ -55,15 +61,26 @@ - True True 0 - False - False + folder + + + + + True + False + vertical + + + + False @@ -97,22 +114,27 @@ - True - False + conversations + + + conversations + + + + + True + False + vertical - False - False + False - - - True @@ -146,6 +168,9 @@ horizontal + + + horizontal @@ -155,6 +180,9 @@ horizontal + + + horizontal diff --git a/ui/geary.css b/ui/geary.css index 0ddfab30..2d1d48c3 100644 --- a/ui/geary.css +++ b/ui/geary.css @@ -12,12 +12,23 @@ border-left-width: 0; border-top-width: 0; border-right-width: 0; + min-width: 300px; } .geary-conversation-frame > border { border-left-width: 0; border-top-width: 0; border-right-width: 0; + min-width: 360px; } + +treeview.sidebar { + border: none; +} + +geary-conversation-viewer { + min-width: 360px; +} + /* For 3-pane mode only */ .geary-sidebar-pane-separator.vertical .conversation-frame > border { border-bottom-width: 0; diff --git a/ui/main-toolbar.ui b/ui/main-toolbar.ui index 732a01b9..441cd146 100644 --- a/ui/main-toolbar.ui +++ b/ui/main-toolbar.ui @@ -7,13 +7,18 @@ False mail-archive-symbolic -