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:
@@ -315,6 +315,29 @@ pub fn build_watermark_page(state: &AppState) -> adw::NavigationPage {
|
||||
.expanded(state.detailed_mode)
|
||||
.build();
|
||||
|
||||
// Text color picker
|
||||
let color_row = adw::ActionRow::builder()
|
||||
.title("Text Color")
|
||||
.subtitle("Color of the watermark text")
|
||||
.build();
|
||||
|
||||
let initial_color = gtk::gdk::RGBA::new(
|
||||
cfg.watermark_color[0] as f32 / 255.0,
|
||||
cfg.watermark_color[1] as f32 / 255.0,
|
||||
cfg.watermark_color[2] as f32 / 255.0,
|
||||
cfg.watermark_color[3] as f32 / 255.0,
|
||||
);
|
||||
let color_dialog = gtk::ColorDialog::builder()
|
||||
.with_alpha(true)
|
||||
.title("Watermark Text Color")
|
||||
.build();
|
||||
let color_button = gtk::ColorDialogButton::builder()
|
||||
.dialog(&color_dialog)
|
||||
.rgba(&initial_color)
|
||||
.valign(gtk::Align::Center)
|
||||
.build();
|
||||
color_row.add_suffix(&color_button);
|
||||
|
||||
let opacity_row = adw::SpinRow::builder()
|
||||
.title("Opacity")
|
||||
.subtitle("0.0 (invisible) to 1.0 (fully opaque)")
|
||||
@@ -347,6 +370,7 @@ pub fn build_watermark_page(state: &AppState) -> adw::NavigationPage {
|
||||
.adjustment(>k::Adjustment::new(20.0, 1.0, 100.0, 1.0, 5.0, 0.0))
|
||||
.build();
|
||||
|
||||
advanced_expander.add_row(&color_row);
|
||||
advanced_expander.add_row(&opacity_row);
|
||||
advanced_expander.add_row(&rotation_row);
|
||||
advanced_expander.add_row(&tiled_row);
|
||||
@@ -424,6 +448,19 @@ pub fn build_watermark_page(state: &AppState) -> adw::NavigationPage {
|
||||
jc.borrow_mut().watermark_opacity = val;
|
||||
});
|
||||
}
|
||||
// Wire color picker
|
||||
{
|
||||
let jc = state.job_config.clone();
|
||||
color_button.connect_rgba_notify(move |btn| {
|
||||
let c = btn.rgba();
|
||||
jc.borrow_mut().watermark_color = [
|
||||
(c.red() * 255.0) as u8,
|
||||
(c.green() * 255.0) as u8,
|
||||
(c.blue() * 255.0) as u8,
|
||||
(c.alpha() * 255.0) as u8,
|
||||
];
|
||||
});
|
||||
}
|
||||
// Wire image chooser button
|
||||
{
|
||||
let jc = state.job_config.clone();
|
||||
|
||||
Reference in New Issue
Block a user