Display no-results message instead of empty-folder when there are no search results

This commit is contained in:
Tim Dengel 2024-08-11 03:57:28 +02:00
parent ffd00fd518
commit ede7b4ae94
No known key found for this signature in database
GPG key ID: 9AD6E826B39C07E9
4 changed files with 5 additions and 1 deletions

View file

@ -1113,7 +1113,7 @@ impl Application for App {
fn on_nav_select(&mut self, entity: Entity) -> Command<Self::Message> {
self.search_active = false;
self.search_input.clear();
self.nav_model.activate(entity);
if let Some(location) = self.nav_model.data::<Location>(entity) {
let message = Message::TabMessage(None, tab::Message::Location(location.clone()));

View file

@ -2294,6 +2294,8 @@ impl Tab {
.into(),
widget::text(if has_hidden {
fl!("empty-folder-hidden")
} else if matches!(self.location, Location::Search(_, _)) {
fl!("no-results")
} else {
fl!("empty-folder")
})