use adw::prelude::*; pub fn build_metadata_page() -> adw::NavigationPage { let scrolled = gtk::ScrolledWindow::builder() .hscrollbar_policy(gtk::PolicyType::Never) .vexpand(true) .build(); let content = gtk::Box::builder() .orientation(gtk::Orientation::Vertical) .spacing(12) .margin_top(12) .margin_bottom(12) .margin_start(24) .margin_end(24) .build(); // Enable toggle let enable_row = adw::SwitchRow::builder() .title("Enable Metadata Handling") .subtitle("Control what image metadata to keep or remove") .active(true) .build(); let enable_group = adw::PreferencesGroup::new(); enable_group.add(&enable_row); content.append(&enable_group); // Quick presets let presets_group = adw::PreferencesGroup::builder() .title("Metadata Mode") .build(); let strip_all_row = adw::ActionRow::builder() .title("Strip All") .subtitle("Remove all metadata - smallest files, maximum privacy") .activatable(true) .build(); strip_all_row.add_prefix(>k::Image::from_icon_name("user-trash-symbolic")); let strip_all_check = gtk::CheckButton::new(); strip_all_check.set_active(true); strip_all_row.add_suffix(&strip_all_check); strip_all_row.set_activatable_widget(Some(&strip_all_check)); let privacy_row = adw::ActionRow::builder() .title("Privacy Mode") .subtitle("Strip GPS and camera serial, keep copyright") .activatable(true) .build(); privacy_row.add_prefix(>k::Image::from_icon_name("security-medium-symbolic")); let privacy_check = gtk::CheckButton::new(); privacy_check.set_group(Some(&strip_all_check)); privacy_row.add_suffix(&privacy_check); privacy_row.set_activatable_widget(Some(&privacy_check)); let keep_all_row = adw::ActionRow::builder() .title("Keep All") .subtitle("Preserve all original metadata") .activatable(true) .build(); keep_all_row.add_prefix(>k::Image::from_icon_name("emblem-ok-symbolic")); let keep_all_check = gtk::CheckButton::new(); keep_all_check.set_group(Some(&strip_all_check)); keep_all_row.add_suffix(&keep_all_check); keep_all_row.set_activatable_widget(Some(&keep_all_check)); presets_group.add(&strip_all_row); presets_group.add(&privacy_row); presets_group.add(&keep_all_row); content.append(&presets_group); // Advanced - per-category controls let advanced_group = adw::PreferencesGroup::builder() .title("Fine-Grained Control") .description("Choose exactly which metadata categories to strip") .build(); let categories = [ ("GPS / Location Data", "Coordinates, altitude, location name", true), ("Camera Info", "Camera model, serial number, lens info", true), ("Software / Editing", "Software used, editing history", true), ("Timestamps", "Date taken, date modified", false), ("Copyright / Author", "Copyright notice, creator name", false), ]; for (title, subtitle, default_strip) in &categories { let row = adw::SwitchRow::builder() .title(format!("Strip {}", title)) .subtitle(*subtitle) .active(*default_strip) .build(); advanced_group.add(&row); } content.append(&advanced_group); scrolled.set_child(Some(&content)); let clamp = adw::Clamp::builder() .maximum_size(600) .child(&scrolled) .build(); adw::NavigationPage::builder() .title("Metadata") .tag("step-metadata") .child(&clamp) .build() }