Add rename template presets and watermark color picker

- Rename step: quick-fill buttons for common patterns (Date+Name,
  EXIF Date+Name, Sequential, Dimensions, Camera+Date, Web-safe)
- Watermark step: color picker in advanced options using ColorDialogButton
- Add watermark_color field to JobConfig, wire through to core
This commit is contained in:
2026-03-06 16:10:05 +02:00
parent 45aaa02f19
commit e976ca2c0a
3 changed files with 80 additions and 2 deletions

View File

@@ -101,6 +101,44 @@ pub fn build_rename_page(state: &AppState) -> adw::NavigationPage {
.text(&cfg.rename_template)
.build();
// Preset template quick-fill buttons
let presets_flow = gtk::FlowBox::builder()
.selection_mode(gtk::SelectionMode::None)
.max_children_per_line(4)
.min_children_per_line(2)
.row_spacing(4)
.column_spacing(4)
.margin_top(4)
.margin_bottom(8)
.margin_start(12)
.margin_end(12)
.homogeneous(false)
.build();
let preset_templates = [
("Date + Name", "{date}_{name}"),
("EXIF Date + Name", "{exif_date}_{name}"),
("Sequential", "{name}_{counter:4}"),
("Dimensions", "{name}_{width}x{height}"),
("Camera + Date", "{camera}_{exif_date}_{counter:3}"),
("Web-safe", "{name}_web"),
];
for (label, template) in &preset_templates {
let btn = gtk::Button::builder()
.label(*label)
.tooltip_text(*template)
.build();
btn.add_css_class("pill");
let tr = template_row.clone();
let tmpl = template.to_string();
btn.connect_clicked(move |_| {
tr.set_text(&tmpl);
});
presets_flow.append(&btn);
}
let help_label = gtk::Label::builder()
.label(
"Available variables:\n\
@@ -145,6 +183,7 @@ pub fn build_rename_page(state: &AppState) -> adw::NavigationPage {
regex_group.add(&replace_row);
advanced_group.add(&template_row);
advanced_group.add(&presets_flow);
advanced_group.add(&help_label);
advanced_group.add(&case_row);
content.append(&advanced_group);