diff --git a/src/contacts-list-pane.vala b/src/contacts-list-pane.vala index e418ea3..c2b9948 100644 --- a/src/contacts-list-pane.vala +++ b/src/contacts-list-pane.vala @@ -88,6 +88,10 @@ public class Contacts.ListPane : Frame { filter_entry_changed_id = Timeout.add (300, filter_entry_changed_timeout); } + public ListPane (Store contacts_store) { + Object (store: contacts_store); + } + construct { search_tool_item.set_expand (true); filter_entry.changed.connect (filter_entry_changed); diff --git a/src/contacts-window.ui b/src/contacts-window.ui index 1f93576..7a7da4a 100644 --- a/src/contacts-window.ui +++ b/src/contacts-window.ui @@ -22,7 +22,7 @@ True False - + True False @@ -47,14 +47,44 @@ - - True - False - contacts_store - - - - + + True + False + center + True + True + vertical + 300 + + + True + False + True + + + + False + True + 0 + + + + + True + False + start + True + Loading + + + False + True + 1 + + + 0 0 @@ -282,11 +312,11 @@ - + horizontal - + diff --git a/src/contacts-window.vala b/src/contacts-window.vala index 509c611..a927eb4 100644 --- a/src/contacts-window.vala +++ b/src/contacts-window.vala @@ -22,6 +22,12 @@ using Folks; [GtkTemplate (ui = "/org/gnome/contacts/contacts-window.ui")] public class Contacts.Window : Gtk.ApplicationWindow { + [GtkChild] + private Grid content_grid; + [GtkChild] + private Box loading_box; + [GtkChild] + private SizeGroup left_pane_size_group; [GtkChild] private HeaderBar left_toolbar; [GtkChild] @@ -29,8 +35,6 @@ public class Contacts.Window : Gtk.ApplicationWindow { [GtkChild] private Overlay overlay; [GtkChild] - private ListPane list_pane; - [GtkChild] private ContactPane contact_pane; [GtkChild] private ToggleButton select_button; @@ -57,6 +61,7 @@ public class Contacts.Window : Gtk.ApplicationWindow { [GtkChild] public Store contacts_store; + private ListPane list_pane; /* FIXME: remove from public what it is not needed */ [GtkChild] @@ -105,6 +110,11 @@ public class Contacts.Window : Gtk.ApplicationWindow { /* Here we need to wait for Store::quiescent */ view_switcher.visible_child_name = "content-view"; set_titlebar (content_header_bar); + + Timeout.add (5000, () => { + this.set_list_pane (); + return false; + }); }); setup_cancel_button.clicked.connect (() => { destroy (); @@ -114,6 +124,20 @@ public class Contacts.Window : Gtk.ApplicationWindow { init_content_widgets (); } + public void set_list_pane () { + list_pane = new ListPane (store); + list_pane.selection_changed.connect (list_pane_selection_changed_cb); + list_pane.link_contacts.connect (list_pane_link_contacts_cb); + list_pane.delete_contacts.connect (list_pane_delete_contacts_cb); + + left_pane_size_group.add_widget (list_pane); + left_pane_size_group.remove_widget (loading_box); + loading_box.destroy (); + + content_grid.attach (list_pane, 0, 0, 1, 1); + list_pane.show (); + } + public void activate_selection_mode (bool active) { if (active) { add_button.hide (); @@ -263,12 +287,10 @@ public class Contacts.Window : Gtk.ApplicationWindow { return false; } - [GtkCallback] void list_pane_selection_changed_cb (Contact? new_selection) { set_shown_contact (new_selection); } - [GtkCallback] void list_pane_link_contacts_cb (LinkedList contact_list) { /* getting out of selection mode */ set_shown_contact (null); @@ -306,7 +328,6 @@ public class Contacts.Window : Gtk.ApplicationWindow { }); } - [GtkCallback] void list_pane_delete_contacts_cb (LinkedList contact_list) { /* getting out of selection mode */ set_shown_contact (null);