Add Adjustments, Watermark, Rename wizard steps; expand to 10-step wizard

This commit is contained in:
2026-03-06 12:15:02 +02:00
parent 662270d7b9
commit 6235d3d686
7 changed files with 796 additions and 12 deletions

View File

@@ -0,0 +1,87 @@
use adw::prelude::*;
use crate::app::AppState;
pub fn build_adjustments_page(state: &AppState) -> adw::NavigationPage {
let scrolled = gtk::ScrolledWindow::builder()
.hscrollbar_policy(gtk::PolicyType::Never)
.vexpand(true)
.build();
let content = gtk::Box::builder()
.orientation(gtk::Orientation::Vertical)
.spacing(12)
.margin_top(12)
.margin_bottom(12)
.margin_start(24)
.margin_end(24)
.build();
let cfg = state.job_config.borrow();
// Rotate
let rotate_group = adw::PreferencesGroup::builder()
.title("Rotation")
.build();
let rotate_row = adw::ComboRow::builder()
.title("Rotate")
.subtitle("Rotation applied after resize")
.build();
let rotate_model = gtk::StringList::new(&[
"None",
"90 clockwise",
"180",
"270 clockwise",
"Auto-orient (EXIF)",
]);
rotate_row.set_model(Some(&rotate_model));
rotate_row.set_selected(cfg.rotation);
rotate_group.add(&rotate_row);
content.append(&rotate_group);
// Flip
let flip_group = adw::PreferencesGroup::builder()
.title("Flip")
.build();
let flip_row = adw::ComboRow::builder()
.title("Flip")
.subtitle("Mirror the image")
.build();
let flip_model = gtk::StringList::new(&["None", "Horizontal", "Vertical"]);
flip_row.set_model(Some(&flip_model));
flip_row.set_selected(cfg.flip);
flip_group.add(&flip_row);
content.append(&flip_group);
drop(cfg);
// Wire signals
{
let jc = state.job_config.clone();
rotate_row.connect_selected_notify(move |row| {
jc.borrow_mut().rotation = row.selected();
});
}
{
let jc = state.job_config.clone();
flip_row.connect_selected_notify(move |row| {
jc.borrow_mut().flip = row.selected();
});
}
scrolled.set_child(Some(&content));
let clamp = adw::Clamp::builder()
.maximum_size(600)
.child(&scrolled)
.build();
adw::NavigationPage::builder()
.title("Adjustments")
.tag("step-adjustments")
.child(&clamp)
.build()
}