Add WebP effort, AVIF speed controls, case conversion and regex rename
- Compress step: WebP Encoding Effort (0-6) and AVIF Encoding Speed (1-10) - Rename step: Case Conversion combo (lowercase/UPPERCASE/Title Case) - Rename step: Find and Replace group with regex pattern and replacement
This commit is contained in:
@@ -118,11 +118,25 @@ pub fn build_compress_page(state: &AppState) -> adw::NavigationPage {
|
|||||||
.active(false)
|
.active(false)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
let webp_effort_row = adw::SpinRow::builder()
|
||||||
|
.title("WebP Encoding Effort")
|
||||||
|
.subtitle("0-6, higher is slower but smaller files")
|
||||||
|
.adjustment(>k::Adjustment::new(4.0, 0.0, 6.0, 1.0, 1.0, 0.0))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
let avif_speed_row = adw::SpinRow::builder()
|
||||||
|
.title("AVIF Encoding Speed")
|
||||||
|
.subtitle("1-10, lower is slower but better compression")
|
||||||
|
.adjustment(>k::Adjustment::new(6.0, 1.0, 10.0, 1.0, 1.0, 0.0))
|
||||||
|
.build();
|
||||||
|
|
||||||
advanced_expander.add_row(&jpeg_row);
|
advanced_expander.add_row(&jpeg_row);
|
||||||
advanced_expander.add_row(&progressive_row);
|
advanced_expander.add_row(&progressive_row);
|
||||||
advanced_expander.add_row(&png_row);
|
advanced_expander.add_row(&png_row);
|
||||||
advanced_expander.add_row(&webp_row);
|
advanced_expander.add_row(&webp_row);
|
||||||
|
advanced_expander.add_row(&webp_effort_row);
|
||||||
advanced_expander.add_row(&avif_row);
|
advanced_expander.add_row(&avif_row);
|
||||||
|
advanced_expander.add_row(&avif_speed_row);
|
||||||
|
|
||||||
advanced_group.add(&advanced_expander);
|
advanced_group.add(&advanced_expander);
|
||||||
content.append(&advanced_group);
|
content.append(&advanced_group);
|
||||||
|
|||||||
@@ -121,9 +121,34 @@ pub fn build_rename_page(state: &AppState) -> adw::NavigationPage {
|
|||||||
.margin_start(12)
|
.margin_start(12)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
let case_row = adw::ComboRow::builder()
|
||||||
|
.title("Case Conversion")
|
||||||
|
.subtitle("Convert filename case")
|
||||||
|
.build();
|
||||||
|
let case_model = gtk::StringList::new(&["No change", "lowercase", "UPPERCASE", "Title Case"]);
|
||||||
|
case_row.set_model(Some(&case_model));
|
||||||
|
|
||||||
|
let regex_group = adw::PreferencesGroup::builder()
|
||||||
|
.title("Find and Replace")
|
||||||
|
.description("Regex find-and-replace on original filename")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
let find_row = adw::EntryRow::builder()
|
||||||
|
.title("Find (regex)")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
let replace_row = adw::EntryRow::builder()
|
||||||
|
.title("Replace with")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
regex_group.add(&find_row);
|
||||||
|
regex_group.add(&replace_row);
|
||||||
|
|
||||||
advanced_group.add(&template_row);
|
advanced_group.add(&template_row);
|
||||||
advanced_group.add(&help_label);
|
advanced_group.add(&help_label);
|
||||||
|
advanced_group.add(&case_row);
|
||||||
content.append(&advanced_group);
|
content.append(&advanced_group);
|
||||||
|
content.append(®ex_group);
|
||||||
|
|
||||||
drop(cfg);
|
drop(cfg);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user