Only show Empty Trash when there is trash

This commit is contained in:
Jason Rodney Hansen 2025-03-07 14:35:00 -07:00
parent 97abc76c8d
commit 51c5c6f8e6

View file

@ -1779,12 +1779,14 @@ impl Application for App {
)); ));
} }
if matches!(location_opt, Some(Location::Trash)) { if matches!(location_opt, Some(Location::Trash)) {
if tab::trash_entries() > 0 {
items.push(cosmic::widget::menu::Item::Button( items.push(cosmic::widget::menu::Item::Button(
fl!("empty-trash"), fl!("empty-trash"),
None, None,
NavMenuAction::EmptyTrash, NavMenuAction::EmptyTrash,
)); ));
} }
}
Some(cosmic::widget::menu::items(&HashMap::new(), items)) Some(cosmic::widget::menu::items(&HashMap::new(), items))
} }