[geary] Set information in titlebar under Unity



commit 577b5fd210060ef6a07dc03e35eed1b7da232780
Author: Robert Schroll <rschroll gmail com>
Date:   Fri Mar 20 01:13:12 2015 -0400

    Set information in titlebar under Unity
    
    Don't display account and folder in headerbar in this case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746134

 src/client/components/main-toolbar.vala |    6 ++++--
 src/client/components/main-window.vala  |   12 ++++++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala
index dfa5c52..1dfc5a4 100644
--- a/src/client/components/main-toolbar.vala
+++ b/src/client/components/main-toolbar.vala
@@ -45,8 +45,10 @@ public class MainToolbar : Gtk.Box {
                 return true;
             });
         
-        this.bind_property("account", folder_header, "title", BindingFlags.SYNC_CREATE);
-        this.bind_property("folder", folder_header, "subtitle", BindingFlags.SYNC_CREATE);
+        if (!GearyApplication.instance.is_running_unity) {
+            this.bind_property("account", folder_header, "title", BindingFlags.SYNC_CREATE);
+            this.bind_property("folder", folder_header, "subtitle", BindingFlags.SYNC_CREATE);
+        }
         this.bind_property("show-close-button-left", folder_header, "show-close-button",
             BindingFlags.SYNC_CREATE);
         this.bind_property("show-close-button-right", conversation_header, "show-close-button",
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index 2f83f26..9648504 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -39,8 +39,6 @@ public class MainWindow : Gtk.ApplicationWindow {
     public MainWindow(GearyApplication application) {
         Object(application: application);
         
-        title = GearyApplication.NAME;
-        
         conversation_list_view = new ConversationListView(conversation_list_store);
         
         add_events(Gdk.EventMask.KEY_PRESS_MASK | Gdk.EventMask.KEY_RELEASE_MASK
@@ -92,6 +90,16 @@ public class MainWindow : Gtk.ApplicationWindow {
         if (!GearyApplication.instance.is_running_unity) {
             main_toolbar.show_close_button = true;
             set_titlebar(main_toolbar);
+            title = GearyApplication.NAME;
+        } else {
+            BindingTransformFunc title_func = (binding, source, ref target) => {
+                target = @"$(GearyApplication.NAME) - $(main_toolbar.account) - $(main_toolbar.folder)";
+                return true;
+            };
+            main_toolbar.bind_property("folder", this, "title",
+                BindingFlags.SYNC_CREATE, title_func);
+            main_toolbar.bind_property("account", this, "title",
+                BindingFlags.SYNC_CREATE, title_func);
         }
         
         set_styling();


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