Wire skill level and accessibility settings to UI

- Add detailed_mode to AppState, derived from skill_level setting
- Expand advanced option sections by default in Detailed mode
  (resize, convert, compress, watermark steps)
- Fix high contrast to use HighContrast GTK theme
- Add completion sound via canberra-gtk-play
This commit is contained in:
2026-03-06 15:28:02 +02:00
parent d6f7fc9c88
commit 5bdeb8a2e3
5 changed files with 10 additions and 5 deletions

View File

@@ -94,6 +94,7 @@ pub struct AppState {
pub excluded_files: Rc<RefCell<std::collections::HashSet<std::path::PathBuf>>>,
pub output_dir: Rc<RefCell<Option<std::path::PathBuf>>>,
pub job_config: Rc<RefCell<JobConfig>>,
pub detailed_mode: bool,
}
#[derive(Clone)]
@@ -218,6 +219,7 @@ fn build_ui(app: &adw::Application) {
loaded_files: Rc::new(RefCell::new(Vec::new())),
excluded_files: Rc::new(RefCell::new(std::collections::HashSet::new())),
output_dir: Rc::new(RefCell::new(None)),
detailed_mode: app_cfg.skill_level.is_advanced(),
job_config: Rc::new(RefCell::new(JobConfig {
resize_enabled: if remember { sess_state.resize_enabled.unwrap_or(true) } else { true },
resize_width: if remember { sess_state.resize_width.unwrap_or(1200) } else { 1200 },
@@ -2503,11 +2505,10 @@ fn apply_accessibility_settings() {
let config = config_store.load().unwrap_or_default();
if config.high_contrast {
// Use libadwaita's high contrast mode
let style_manager = adw::StyleManager::default();
style_manager.set_color_scheme(adw::ColorScheme::ForceLight);
// High contrast is best achieved via the GTK_THEME env or system
// settings; the app respects system high contrast automatically
// Request high contrast by switching to the HighContrast theme.
// This works on GNOME systems with the standard HC theme installed.
let settings = gtk::Settings::default().unwrap();
settings.set_gtk_theme_name(Some("HighContrast"));
}
let settings = gtk::Settings::default().unwrap();