diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2018-01-12 15:24:11 +0100 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2018-01-12 15:24:11 +0100 |
commit | 67852bafefc36f47f0c90df3b0e3c16e275dda77 (patch) | |
tree | 1781a269269834aebd6dee8ec7425af51842b182 /src | |
parent | 971fc8537b183014ebaab04ebae8e2876be43e88 (diff) | |
download | gnome-contacts-67852bafefc36f47f0c90df3b0e3c16e275dda77.tar.gz |
ContactsWindow: no need for a selection_mode-property.
Since it's only set using `activate_selection_mode()` we don't need
to have an explcit property.
Also merges the "constraints" (i.e. what should be visible when
selecting) at the same place.
Diffstat (limited to 'src')
-rw-r--r-- | src/contacts-window.vala | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/contacts-window.vala b/src/contacts-window.vala index 99eeeab..6f94542 100644 --- a/src/contacts-window.vala +++ b/src/contacts-window.vala @@ -61,9 +61,7 @@ public class Contacts.Window : Gtk.ApplicationWindow { get; construct set; } - public bool selection_mode { - get; set; - } + private bool selection_mode = false; public bool edit_mode { get; set; @@ -78,19 +76,6 @@ public class Contacts.Window : Gtk.ApplicationWindow { debug ("everyone creation: finalized already!!!"); /* stablishing constraints */ - this.bind_property ("selection-mode", - right_header, "show-close-button", - BindingFlags.DEFAULT | - BindingFlags.INVERT_BOOLEAN); - this.bind_property ("selection-mode", - add_button, "visible", - BindingFlags.DEFAULT | - BindingFlags.INVERT_BOOLEAN); - this.bind_property ("selection-mode", - edit_button, "visible", - BindingFlags.DEFAULT | - BindingFlags.INVERT_BOOLEAN); - this.bind_property ("edit-mode", edit_button, "visible", BindingFlags.DEFAULT | @@ -164,8 +149,14 @@ public class Contacts.Window : Gtk.ApplicationWindow { public void activate_selection_mode (bool active) { this.selection_mode = active; - this.select_button.visible = !active; + + // Show some buttons when selecting (and vice versa) this.select_cancel_button.visible = active; + // and hide some + this.select_button.visible = !active; + this.add_button.visible = !active; + this.edit_button.visible = !active; + this.right_header.show_close_button = !active; if (active) { left_header.get_style_context ().add_class ("selection-mode"); |