diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2018-01-09 18:38:36 +0100 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2018-01-09 19:29:40 +0100 |
commit | 3036c8730d8ae31b2890d88441bdad093f37d534 (patch) | |
tree | 2ef96a3e007b9e02dbd246999aa1dbc6a07f702c | |
parent | e7866ce717520bcf2258e90887bf1435d78d6a3e (diff) | |
download | gnome-contacts-3036c8730d8ae31b2890d88441bdad093f37d534.tar.gz |
ContactsWindow: split init_content_widgets()
Just to make it more obvious what they're actually doing.
-rw-r--r-- | src/contacts-window.vala | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/contacts-window.vala b/src/contacts-window.vala index 2506538..99eeeab 100644 --- a/src/contacts-window.vala +++ b/src/contacts-window.vala @@ -118,7 +118,8 @@ public class Contacts.Window : Gtk.ApplicationWindow { view_switcher.visible_child_name = "content-view"; - init_content_widgets (); + set_headerbar_layout (); + connect_button_signals (); } private void create_contact_pane () { @@ -270,18 +271,18 @@ public class Contacts.Window : Gtk.ApplicationWindow { list_pane.filter_entry.set_text (query); } - /* internal API */ - void init_content_widgets () { - string layout_desc; - string[] tokens; - - layout_desc = Gtk.Settings.get_default ().gtk_decoration_layout; - tokens = layout_desc.split (":", 2); + private void set_headerbar_layout () { + // Propagate the decoration layout to the separate headerbars, so + // that we know, for example, on which side the close button should be. + string layout_desc = Gtk.Settings.get_default ().gtk_decoration_layout; + string[] tokens = layout_desc.split (":", 2); if (tokens != null) { - right_header.decoration_layout = ":%s".printf (tokens[1]); - left_header.decoration_layout = tokens[0]; + this.right_header.decoration_layout = ":%s".printf (tokens[1]); + this.left_header.decoration_layout = tokens[0]; } + } + private void connect_button_signals () { this.select_button.clicked.connect (() => activate_selection_mode (true)); this.select_cancel_button.clicked.connect (() => activate_selection_mode (false)); this.edit_button.clicked.connect (() => enter_edit_mode ()); |