Wire up step buttons: Browse, preset cards, output directory picker
- Browse Files button triggers win.add-files action - Add More button in loaded state triggers win.add-files action - Preset card activation (click) advances to next wizard step - Custom workflow card activation advances to next step - Choose output folder button opens folder dialog - Output step shows current image count when navigated to - Clean up dead code in update_count_in_box
This commit is contained in:
@@ -72,6 +72,7 @@ fn build_empty_state() -> gtk::Box {
|
||||
.label("Browse Files")
|
||||
.tooltip_text("Add image files (Ctrl+O)")
|
||||
.halign(gtk::Align::Center)
|
||||
.action_name("win.add-files")
|
||||
.build();
|
||||
browse_button.add_css_class("suggested-action");
|
||||
browse_button.add_css_class("pill");
|
||||
@@ -112,6 +113,7 @@ fn build_loaded_state() -> gtk::Box {
|
||||
let add_button = gtk::Button::builder()
|
||||
.icon_name("list-add-symbolic")
|
||||
.tooltip_text("Add more images")
|
||||
.action_name("win.add-files")
|
||||
.build();
|
||||
add_button.add_css_class("flat");
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ pub fn build_output_page() -> adw::NavigationPage {
|
||||
.icon_name("folder-open-symbolic")
|
||||
.tooltip_text("Choose output folder")
|
||||
.valign(gtk::Align::Center)
|
||||
.action_name("win.choose-output")
|
||||
.build();
|
||||
choose_button.add_css_class("flat");
|
||||
output_row.add_suffix(&choose_button);
|
||||
|
||||
@@ -36,6 +36,11 @@ pub fn build_workflow_page() -> adw::NavigationPage {
|
||||
builtin_flow.append(&card);
|
||||
}
|
||||
|
||||
// When a preset card is activated, advance to the next step
|
||||
builtin_flow.connect_child_activated(|flow, _child| {
|
||||
flow.activate_action("win.next-step", None).ok();
|
||||
});
|
||||
|
||||
builtin_group.add(&builtin_flow);
|
||||
content.append(&builtin_group);
|
||||
|
||||
@@ -52,6 +57,9 @@ pub fn build_workflow_page() -> adw::NavigationPage {
|
||||
.min_children_per_line(2)
|
||||
.build();
|
||||
custom_flow.append(&custom_card);
|
||||
custom_flow.connect_child_activated(|flow, _child| {
|
||||
flow.activate_action("win.next-step", None).ok();
|
||||
});
|
||||
custom_group.add(&custom_flow);
|
||||
content.append(&custom_group);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user