[gnome-contacts] Contacts.Window: hide toolbars from Contacts.App



commit ffdef3783d3ae505234455a1439e157290bfa23f
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Thu Aug 15 11:03:11 2013 -0400

    Contacts.Window: hide toolbars from Contacts.App

 src/contacts-app.vala    |   12 ++++++------
 src/contacts-window.vala |   21 ++++++++++++++++++++-
 2 files changed, 26 insertions(+), 7 deletions(-)
---
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index d52e39c..80ad9f1 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -68,7 +68,7 @@ public class Contacts.App : Gtk.Application {
     if (contacts_pane.on_edit_mode) {
       contacts_pane.set_edit_mode (false);
 
-      window.right_toolbar.set_title ("");
+      window.right_title = "";
       window.done_button.hide ();
     }
 
@@ -258,9 +258,9 @@ public class Contacts.App : Gtk.Application {
     list_pane.delete_contacts.connect (delete_contacts);
     list_pane.contacts_marked.connect ((nr_contacts) => {
        if (nr_contacts == 0)
-         window.left_toolbar.set_title (_("Select"));
+         window.left_title = _("Select");
        else
-         window.left_toolbar.set_title (_("%d Selected").printf (nr_contacts));
+         window.left_title = _("%d Selected").printf (nr_contacts);
       });
 
     grid.attach (list_pane, 0, 1, 1, 1);
@@ -308,14 +308,14 @@ public class Contacts.App : Gtk.Application {
           name += " %s".printf (contacts_pane.contact.display_name);
         }
 
-       window.right_toolbar.set_title (name);
+       window.right_title = name;
         window.edit_button.hide ();
         window.done_button.show ();
         contacts_pane.set_edit_mode (true);
       });
 
     window.done_button.clicked.connect (() => {
-       window.right_toolbar.set_title ("");
+       window.right_title = "";
         window.done_button.hide ();
         window.edit_button.show ();
         contacts_pane.set_edit_mode (false);
@@ -485,7 +485,7 @@ public class Contacts.App : Gtk.Application {
 
   private void delete_contact (Contact contact) {
     /* unsetting edit-mode */
-    window.right_toolbar.set_title ("");
+    window.right_title = "";
     window.done_button.hide ();
     contacts_pane.set_edit_mode (false);
 
diff --git a/src/contacts-window.vala b/src/contacts-window.vala
index 8676894..67c38b0 100644
--- a/src/contacts-window.vala
+++ b/src/contacts-window.vala
@@ -26,15 +26,34 @@ using Folks;
  * 4. this will remove the window.edit_button from contacts-app.vala */
 
 public class Contacts.Window : Gtk.ApplicationWindow {
+  private HeaderBar right_toolbar;
+
   /* FIXME: remove from public what it is not needed */
   public HeaderBar left_toolbar;
   public Button add_button;
   public Gd.HeaderToggleButton select_button;
 
-  public HeaderBar right_toolbar;
   public Button edit_button;
   public Button done_button;
 
+  public string left_title {
+    get {
+      return left_toolbar.get_title ();
+    }
+    set {
+      left_toolbar.set_title (value);
+    }
+  }
+
+  public string right_title {
+    get {
+      return right_toolbar.get_title ();
+    }
+    set {
+      right_toolbar.set_title (value);
+    }
+  }
+
   public Window (Gtk.Application app) {
     Object (application: app);
 


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