Add Ctrl+A and Ctrl+Shift+A keyboard shortcuts for select/deselect all

- Register select-all-images and deselect-all-images actions
- Wire Ctrl+A to clear exclusion set, Ctrl+Shift+A to exclude all
- Both shortcuts update checkbox state and count label in images step
- Make set_all_checkboxes_in public for cross-module access
This commit is contained in:
2026-03-06 13:33:06 +02:00
parent 819ac963de
commit 137bb77faa
2 changed files with 54 additions and 4 deletions

View File

@@ -437,7 +437,7 @@ fn build_loaded_state(state: &AppState) -> gtk::Box {
&& let Some(stack) = parent.downcast_ref::<gtk::Stack>()
&& let Some(loaded_widget) = stack.child_by_name("loaded")
{
set_all_checkboxes(&loaded_widget, true);
set_all_checkboxes_in(&loaded_widget, true);
update_count_label(&loaded_widget, &loaded, &excl);
}
});
@@ -459,7 +459,7 @@ fn build_loaded_state(state: &AppState) -> gtk::Box {
&& let Some(stack) = parent.downcast_ref::<gtk::Stack>()
&& let Some(loaded_widget) = stack.child_by_name("loaded")
{
set_all_checkboxes(&loaded_widget, false);
set_all_checkboxes_in(&loaded_widget, false);
update_count_label(&loaded_widget, &loaded, &excl);
}
});
@@ -498,14 +498,14 @@ fn build_loaded_state(state: &AppState) -> gtk::Box {
}
/// Set all CheckButton widgets within a container to a given state
fn set_all_checkboxes(widget: &gtk::Widget, active: bool) {
pub fn set_all_checkboxes_in(widget: &gtk::Widget, active: bool) {
if let Some(check) = widget.downcast_ref::<gtk::CheckButton>() {
check.set_active(active);
return; // Don't recurse into CheckButton children
}
let mut child = widget.first_child();
while let Some(c) = child {
set_all_checkboxes(&c, active);
set_all_checkboxes_in(&c, active);
child = c.next_sibling();
}
}