[gnome-contacts] Contacts.Window: hide more UI details
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Contacts.Window: hide more UI details
- Date: Thu, 15 Aug 2013 17:07:02 +0000 (UTC)
commit acf581bcf50e84bb438295f09b0a7af55944532a
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Thu Aug 15 11:02:42 2013 -0400
Contacts.Window: hide more UI details
src/contacts-app.vala | 14 ++++----------
src/contacts-window.vala | 18 ++++++++++++++++++
2 files changed, 22 insertions(+), 10 deletions(-)
---
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index 0648a21..d52e39c 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -288,20 +288,14 @@ public class Contacts.App : Gtk.Application {
window.select_button.toggled.connect (() => {
if (window.select_button.active) {
/* Update UI */
- window.add_button.hide ();
- window.left_toolbar.set_title (_("Select"));
- window.left_toolbar.get_style_context ().add_class ("selection-mode");
- window.right_toolbar.get_style_context ().add_class ("selection-mode");
+ window.activate_selection_mode (true);
list_pane.show_selection ();
} else {
- /* Update UI */
- window.add_button.show ();
- window.left_toolbar.set_title (_("All Contacts"));
- window.left_toolbar.get_style_context ().remove_class ("selection-mode");
- window.right_toolbar.get_style_context ().remove_class ("selection-mode");
-
list_pane.hide_selection ();
+
+ /* Update UI */
+ window.activate_selection_mode (false);
}
});
diff --git a/src/contacts-window.vala b/src/contacts-window.vala
index 1b05475..8676894 100644
--- a/src/contacts-window.vala
+++ b/src/contacts-window.vala
@@ -77,4 +77,22 @@ public class Contacts.Window : Gtk.ApplicationWindow {
titlebar.show_all ();
set_titlebar (titlebar);
}
+
+ public void activate_selection_mode (bool active) {
+ if (active) {
+ add_button.hide ();
+
+ left_toolbar.get_style_context ().add_class ("selection-mode");
+ right_toolbar.get_style_context ().add_class ("selection-mode");
+
+ left_toolbar.set_title (_("Select"));
+ } else {
+ add_button.show ();
+
+ left_toolbar.get_style_context ().remove_class ("selection-mode");
+ right_toolbar.get_style_context ().remove_class ("selection-mode");
+
+ left_toolbar.set_title (_("All Contacts"));
+ }
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]