Skip to content

Commit 5075cb5

Browse files
committed
Add empty view on exportable apps dialog
1 parent aadd8c5 commit 5075cb5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/exportable_apps_dialog.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ mod imp {
6868
export_apps_group.add(&self.list_box);
6969
self.stack.add_named(&export_apps_group, Some("apps"));
7070

71+
let empty_page = adw::StatusPage::new();
72+
empty_page.set_title("No Exportable Apps");
73+
74+
self.stack.add_named(&empty_page, Some("empty"));
75+
7176
self.content.append(&self.scrolled_window);
7277
self.toolbar_view.set_content(Some(&self.content));
7378
self.obj().set_child(Some(&self.toolbar_view));
@@ -130,6 +135,12 @@ impl ExportableAppsDialog {
130135
let this_clone = this.clone();
131136
container.apps().connect_data_changed(move |resource| {
132137
let apps = resource.data::<gio::ListStore>().unwrap();
138+
139+
if apps.n_items() == 0 {
140+
this_clone.imp().stack.set_visible_child_name("empty");
141+
return;
142+
}
143+
133144
this_clone.imp().stack.set_visible_child_name("apps");
134145

135146
let this = this_clone.clone();

0 commit comments

Comments
 (0)