//! Appearance settings (`ui.theme`, `ui.font_scale`, `ui.narrow_breakpoint`, //! `ui.image_cache_mb`, `ui.members_width`, `ui.voice_compact`): applied to //! the Theme and Nav globals and the image cache whenever they change, from //! the settings page or elsewhere. use slint::ComponentHandle; use tracing::warn; use crate::app::{App, Bridge, Nav, Theme}; use crate::images; use crate::settings::{ ThemeChoice, UI_FONT_SCALE, UI_IMAGE_CACHE_MB, UI_MEMBERS_WIDTH, UI_NARROW_BREAKPOINT, UI_THEME, UI_VOICE_COMPACT, }; use crate::vm::bridge::AppearanceForm; impl App { /// Show the current values of the appearance keys. pub(crate) fn apply_appearance(&self) { let theme = self.prefs.get(&UI_THEME); let scale = self.prefs.get(&UI_FONT_SCALE); let breakpoint = self.prefs.get(&UI_NARROW_BREAKPOINT); let cache_mb = self.prefs.get(&UI_IMAGE_CACHE_MB); images::set_budget_mb(cache_mb); let Some(ui) = self.ui.upgrade() else { return }; let t = ui.global::(); t.set_mode(theme.as_str().into()); t.set_font_scale(scale); let nav = ui.global::