Say when a filter hides the photos of an empty grid or filmstrip

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Clément L 2026-10-04 10:42:34 +02:00
parent d6be9f6342
commit 257a982678
2 changed files with 13 additions and 3 deletions

View File

@ -1219,6 +1219,11 @@ pub(crate) fn filmstrip(app: &mut LightcraftApp, ui: &mut egui::Ui, r: Rect) {
let active = app.session.selection.active;
let cell_w = 120.0;
let ppp = ui.ctx().pixels_per_point();
if ids.is_empty() {
let why = if app.session.filter != Default::default() { "No photos match the filters (View → Clear Filters)" } else { "No photos" };
ui.painter().text(r.center(), Align2::CENTER_CENTER, why, t.font(12.5), t.text_dim);
return;
}
let mut child = ui.new_child(egui::UiBuilder::new().max_rect(r.shrink2(vec2(0.0, 4.0))));
// a vertical mouse wheel scrolls the strip sideways (horizontal trackpad scrolls still work)
child.style_mut().always_scroll_the_only_direction = true;

View File

@ -46,10 +46,15 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui) {
}
app.canvas_rect = Some(ui.max_rect());
if ids.is_empty() {
if app.session.source == lightcraft_engine::LibrarySource::Folder {
if app.session.filter != Default::default() {
super::empty_message(
ui,
ui.max_rect(),
"No matching photos",
"A filter is hiding this view's photos: change it, or clear it (View → Clear Filters)",
);
} else if app.session.source == lightcraft_engine::LibrarySource::Folder {
super::empty_message(ui, ui.max_rect(), "No photos in this folder", "Turn on Include subfolders, or pick another folder under Local");
} else if app.session.filter != Default::default() {
super::empty_message(ui, ui.max_rect(), "No matching photos", "Change the filter, or clear it (View → Clear Filters)");
} else {
super::empty_message(ui, ui.max_rect(), "No photos", "Add photos with File → Add Photos (Cmd+Shift+I), or drop them here");
}