Wire missing UI controls to job config
- Add adjustments_enabled field and guard rotation/flip/adjustments behind it - Wire adjustments toggle in workflow step - Wire progressive JPEG toggle in convert and compress steps - Wire format mapping ComboRows (JPEG/PNG/WebP/TIFF) in convert step - Wire AVIF quality, WebP effort, AVIF speed controls in compress step - Initialize all new controls from current config values
This commit is contained in:
@@ -150,7 +150,7 @@ pub fn build_convert_page(state: &AppState) -> adw::NavigationPage {
|
||||
let progressive_row = adw::SwitchRow::builder()
|
||||
.title("Progressive JPEG")
|
||||
.subtitle("Loads gradually in browsers, slightly larger")
|
||||
.active(false)
|
||||
.active(cfg.progressive_jpeg)
|
||||
.build();
|
||||
|
||||
// Format mapping rows - per input format output selection
|
||||
@@ -167,24 +167,28 @@ pub fn build_convert_page(state: &AppState) -> adw::NavigationPage {
|
||||
.subtitle("Output format for JPEG source files")
|
||||
.build();
|
||||
jpeg_mapping.set_model(Some(>k::StringList::new(&output_choices)));
|
||||
jpeg_mapping.set_selected(cfg.format_mapping_jpeg);
|
||||
|
||||
let png_mapping = adw::ComboRow::builder()
|
||||
.title("PNG inputs")
|
||||
.subtitle("Output format for PNG source files")
|
||||
.build();
|
||||
png_mapping.set_model(Some(>k::StringList::new(&output_choices)));
|
||||
png_mapping.set_selected(cfg.format_mapping_png);
|
||||
|
||||
let webp_mapping = adw::ComboRow::builder()
|
||||
.title("WebP inputs")
|
||||
.subtitle("Output format for WebP source files")
|
||||
.build();
|
||||
webp_mapping.set_model(Some(>k::StringList::new(&output_choices)));
|
||||
webp_mapping.set_selected(cfg.format_mapping_webp);
|
||||
|
||||
let tiff_mapping = adw::ComboRow::builder()
|
||||
.title("TIFF inputs")
|
||||
.subtitle("Output format for TIFF source files")
|
||||
.build();
|
||||
tiff_mapping.set_model(Some(>k::StringList::new(&output_choices)));
|
||||
tiff_mapping.set_selected(cfg.format_mapping_tiff);
|
||||
|
||||
advanced_expander.add_row(&progressive_row);
|
||||
advanced_expander.add_row(&mapping_header);
|
||||
@@ -222,6 +226,36 @@ pub fn build_convert_page(state: &AppState) -> adw::NavigationPage {
|
||||
label.set_label(&format_info(c.convert_format));
|
||||
});
|
||||
}
|
||||
{
|
||||
let jc = state.job_config.clone();
|
||||
progressive_row.connect_active_notify(move |row| {
|
||||
jc.borrow_mut().progressive_jpeg = row.is_active();
|
||||
});
|
||||
}
|
||||
{
|
||||
let jc = state.job_config.clone();
|
||||
jpeg_mapping.connect_selected_notify(move |row| {
|
||||
jc.borrow_mut().format_mapping_jpeg = row.selected();
|
||||
});
|
||||
}
|
||||
{
|
||||
let jc = state.job_config.clone();
|
||||
png_mapping.connect_selected_notify(move |row| {
|
||||
jc.borrow_mut().format_mapping_png = row.selected();
|
||||
});
|
||||
}
|
||||
{
|
||||
let jc = state.job_config.clone();
|
||||
webp_mapping.connect_selected_notify(move |row| {
|
||||
jc.borrow_mut().format_mapping_webp = row.selected();
|
||||
});
|
||||
}
|
||||
{
|
||||
let jc = state.job_config.clone();
|
||||
tiff_mapping.connect_selected_notify(move |row| {
|
||||
jc.borrow_mut().format_mapping_tiff = row.selected();
|
||||
});
|
||||
}
|
||||
|
||||
scrolled.set_child(Some(&content));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user