Commit 7b994ece authored by Michael Gratton's avatar Michael Gratton 🍸
Browse files

client: Move MainToolbar into the Components name space proper

parent 1de50614
......@@ -44,6 +44,7 @@ src/client/components/components-in-app-notification.vala
src/client/components/components-info-bar-stack.vala
src/client/components/components-info-bar.vala
src/client/components/components-inspector.vala
src/client/components/components-main-toolbar.vala
src/client/components/components-placeholder-pane.vala
src/client/components/components-preferences-window.vala
src/client/components/components-problem-report-info-bar.vala
......@@ -54,7 +55,6 @@ src/client/components/components-web-view.vala
src/client/components/count-badge.vala
src/client/components/folder-popover.vala
src/client/components/icon-factory.vala
src/client/components/main-toolbar.vala
src/client/components/monitored-progress-bar.vala
src/client/components/monitored-spinner.vala
src/client/components/status-bar.vala
......@@ -465,6 +465,8 @@ ui/components-info-bar.ui
ui/components-inspector-error-view.ui
ui/components-inspector-log-view.ui
ui/components-inspector.ui
ui/components-main-toolbar.ui
ui/components-main-toolbar-menus.ui
ui/components-placeholder-pane.ui
ui/conversation-contact-popover.ui
ui/conversation-email.ui
......@@ -476,7 +478,5 @@ ui/conversation-viewer.ui
ui/find_bar.glade
ui/folder-popover.ui
ui/gtk/help-overlay.ui
ui/main-toolbar.ui
ui/main-toolbar-menus.ui
ui/password-dialog.glade
ui/problem-details-dialog.ui
......@@ -302,7 +302,7 @@ public class Application.MainWindow :
// Widget descendants
public FolderList.Tree folder_list { get; private set; default = new FolderList.Tree(); }
public MainToolbar main_toolbar { get; private set; }
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; }
......@@ -1303,7 +1303,9 @@ public class Application.MainWindow :
BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL);
// Main toolbar
this.main_toolbar = new MainToolbar(config, conversation_viewer_action_bar);
this.main_toolbar = new Components.MainToolbar(
config, conversation_viewer_action_bar
);
this.main_toolbar.add_to_size_groups(this.folder_size_group,
this.folder_separator_size_group,
this.conversations_size_group,
......
......@@ -41,7 +41,7 @@ public class Components.ConversationActions : GLib.Object {
new Gtk.Builder.from_resource("/org/gnome/Geary/components-conversation-actions.ui");
// Assemble the mark menus
Gtk.Builder menu_builder =
new Gtk.Builder.from_resource("/org/gnome/Geary/main-toolbar-menus.ui");
new Gtk.Builder.from_resource("/org/gnome/Geary/components-main-toolbar-menus.ui");
MenuModel mark_menu = (MenuModel) menu_builder.get_object("mark_message_menu");
this.mark_copy_move_buttons = (Gtk.Box) builder.get_object("mark_copy_move_buttons");
......
/* Copyright 2017 Software Freedom Conservancy Inc.
/*
* Copyright © 2017 Software Freedom Conservancy Inc.
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
* (version 2.1 or later). See the COPYING file in this distribution.
*/
// Draws the main toolbar.
[GtkTemplate (ui = "/org/gnome/Geary/main-toolbar.ui")]
public class MainToolbar : Hdy.Leaflet {
/**
* The toolbar for the main window.
*
* @see Application.MainWindow
*/
[GtkTemplate (ui = "/org/gnome/Geary/components-main-toolbar.ui")]
public class Components.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
public string account { get; set; }
public string folder { get; set; }
// Close button settings
public bool show_close_button { get; set; default = true; }
// Search bar
public bool search_open { get; set; default = false; }
private Components.ConversationActionBar conversation_viewer_action_bar;
private ConversationActionBar conversation_viewer_action_bar;
[GtkChild] private unowned Hdy.Leaflet conversations_leaflet;
......@@ -34,14 +44,14 @@ public class MainToolbar : Hdy.Leaflet {
[GtkChild] private unowned Gtk.Separator conversations_separator;
// Conversation header elements
[GtkChild] private unowned Components.ConversationHeaderBar conversation_header;
[GtkChild] private unowned ConversationHeaderBar conversation_header;
[GtkChild] private unowned Hdy.HeaderGroup header_group;
Gtk.SizeGroup conversation_group;
public MainToolbar(Application.Configuration config,
Components.ConversationActionBar action_bar) {
ConversationActionBar action_bar) {
if (config.desktop_environment != UNITY) {
this.bind_property("account", this.conversations_header, "title", BindingFlags.SYNC_CREATE);
this.bind_property("folder", this.conversations_header, "subtitle", BindingFlags.SYNC_CREATE);
......@@ -50,7 +60,7 @@ public class MainToolbar : Hdy.Leaflet {
this.conversation_header.action_bar = action_bar;
// Assemble the main/mark menus
Gtk.Builder builder = new Gtk.Builder.from_resource("/org/gnome/Geary/main-toolbar-menus.ui");
Gtk.Builder builder = new Gtk.Builder.from_resource("/org/gnome/Geary/components-main-toolbar-menus.ui");
MenuModel main_menu = (MenuModel) builder.get_object("main_menu");
// Setup folder header elements
......@@ -97,7 +107,7 @@ public class MainToolbar : Hdy.Leaflet {
conversation_group.add_swipeable(this);
}
public void add_conversation_actions(Components.ConversationActions actions) {
public void add_conversation_actions(ConversationActions actions) {
conversation_header.add_conversation_actions(actions);
}
......
......@@ -27,14 +27,14 @@ public class Composer.Box : Gtk.Frame, Container {
/** {@inheritDoc} */
internal Widget composer { get; set; }
private MainToolbar main_toolbar { get; private set; }
private Components.MainToolbar main_toolbar { get; private set; }
/** Emitted when the container is closed. */
public signal void vanished();
public Box(Widget composer, MainToolbar main_toolbar) {
public Box(Widget composer, Components.MainToolbar main_toolbar) {
this.composer = composer;
this.composer.set_mode(PANED);
......
......@@ -57,6 +57,7 @@ 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',
......@@ -67,7 +68,6 @@ client_vala_sources = files(
'components/count-badge.vala',
'components/folder-popover.vala',
'components/icon-factory.vala',
'components/main-toolbar.vala',
'components/monitored-progress-bar.vala',
'components/monitored-spinner.vala',
'components/status-bar.vala',
......
......@@ -6,7 +6,7 @@
<property name="visible">True</property>
<property name="icon_name">mail-archive-symbolic</property>
</object>
<template class="MainToolbar" parent="HdyLeaflet">
<template class="ComponentsMainToolbar" parent="HdyLeaflet">
<property name="visible">True</property>
<property name="can_swipe_back">True</property>
<property name="transition_type">over</property>
......@@ -19,7 +19,7 @@
<child>
<object class="HdyHeaderBar" id="folder_header">
<property name="visible">True</property>
<property name="show_close_button" bind-source="MainToolbar" bind-property="show_close_button" bind-flags="sync-create"/>
<property name="show_close_button" bind-source="ComponentsMainToolbar" bind-property="show_close_button" bind-flags="sync-create"/>
<property name="title">Mail</property>
<child>
<object class="GtkMenuButton" id="main_menu_button">
......@@ -60,7 +60,7 @@
<object class="HdyHeaderBar" id="conversations_header">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="show_close_button" bind-source="MainToolbar" bind-property="show_close_button" bind-flags="sync-create"/>
<property name="show_close_button" bind-source="ComponentsMainToolbar" bind-property="show_close_button" bind-flags="sync-create"/>
<child>
<object class="GtkButton" id="conversations_back">
<property name="receives_default">False</property>
......@@ -144,8 +144,8 @@
</child>
<child>
<object class="ComponentsConversationHeaderBar" id="conversation_header">
<property name="show_close_button" bind-source="MainToolbar" bind-property="show_close_button" bind-flags="sync-create"/>
<property name="folded" bind-source="MainToolbar" bind-property="folded" bind-flags="sync-create"/>
<property name="show_close_button" bind-source="ComponentsMainToolbar" bind-property="show_close_button" bind-flags="sync-create"/>
<property name="folded" bind-source="ComponentsMainToolbar" bind-property="folded" bind-flags="sync-create"/>
</object>
<packing>
<property name="name">conversation</property>
......@@ -160,7 +160,7 @@
</headerbars>
</object>
<object class="HdyHeaderGroup" id="header_group">
<property name="decorate-all" bind-source="MainToolbar" bind-property="folded" bind-flags="sync-create"/>
<property name="decorate-all" bind-source="ComponentsMainToolbar" bind-property="folded" bind-flags="sync-create"/>
<headerbars>
<headerbar name="conversations_header_group"/>
<headerbar name="conversation_header"/>
......
......@@ -21,6 +21,8 @@
<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-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>
......@@ -41,8 +43,6 @@
<file compressed="true" preprocess="xml-stripblanks">find_bar.glade</file>
<file compressed="true" preprocess="xml-stripblanks">folder-popover.ui</file>
<file compressed="true" preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file compressed="true" preprocess="xml-stripblanks">main-toolbar.ui</file>
<file compressed="true" preprocess="xml-stripblanks">main-toolbar-menus.ui</file>
<file compressed="true" preprocess="xml-stripblanks">password-dialog.glade</file>
<file compressed="true" preprocess="xml-stripblanks">problem-details-dialog.ui</file>
<file compressed="true">signature-web-view.js</file>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment