Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/Widgets/NotificationsList.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class Notifications.NotificationsList : Granite.Bin {
}
}

private Gtk.Stack stack;

construct {
app_datetime = new GLib.HashTable<string, GLib.DateTime> (str_hash, str_equal);

Expand All @@ -43,10 +45,13 @@ public class Notifications.NotificationsList : Granite.Bin {
selection_mode = NONE
};
listbox.bind_model (sort_list_model, create_widget_func);
listbox.set_placeholder (placeholder);
listbox.set_header_func (header_func);

child = listbox;
stack = new Gtk.Stack ();
stack.add_named (placeholder, "placeholder");
stack.add_named (listbox, "list");

child = stack;

insert_action_group (ACTION_GROUP_PREFIX, new NotificationsMonitor ().notifications_action_group);

Expand Down Expand Up @@ -151,7 +156,10 @@ public class Notifications.NotificationsList : Granite.Bin {

private void on_items_changed () {
if (list_store.n_items == 0) {
stack.visible_child_name = "placeholder";
Session.get_instance ().clear ();
} else {
stack.visible_child_name = "list";
}

items_changed ();
Expand Down
Loading