Add font family selector for watermark text
Font picker using GTK FontDialog/FontDialogButton lets users choose any installed system font for text watermarks. The selected font family is passed through the processing pipeline and used to find the matching font file on disk.
This commit is contained in:
@@ -66,6 +66,7 @@ pub struct JobConfig {
|
||||
pub watermark_opacity: f32,
|
||||
pub watermark_font_size: f32,
|
||||
pub watermark_color: [u8; 4],
|
||||
pub watermark_font_family: String,
|
||||
pub watermark_use_image: bool,
|
||||
// Rename
|
||||
pub rename_enabled: bool,
|
||||
@@ -360,6 +361,7 @@ fn build_ui(app: &adw::Application) {
|
||||
watermark_opacity: 0.5,
|
||||
watermark_font_size: 24.0,
|
||||
watermark_color: [255, 255, 255, 255],
|
||||
watermark_font_family: String::new(),
|
||||
watermark_use_image: false,
|
||||
rename_enabled: if remember { sess_state.rename_enabled.unwrap_or(false) } else { false },
|
||||
rename_prefix: String::new(),
|
||||
@@ -1666,6 +1668,7 @@ fn run_processing(_window: &adw::ApplicationWindow, ui: &WizardUi) {
|
||||
font_size: cfg.watermark_font_size,
|
||||
opacity: cfg.watermark_opacity,
|
||||
color: cfg.watermark_color,
|
||||
font_family: if cfg.watermark_font_family.is_empty() { None } else { Some(cfg.watermark_font_family.clone()) },
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -2595,6 +2598,7 @@ fn build_preset_from_config(cfg: &JobConfig, name: &str) -> pixstrip_core::prese
|
||||
font_size: cfg.watermark_font_size,
|
||||
opacity: cfg.watermark_opacity,
|
||||
color: cfg.watermark_color,
|
||||
font_family: if cfg.watermark_font_family.is_empty() { None } else { Some(cfg.watermark_font_family.clone()) },
|
||||
})
|
||||
} else {
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user