feat(a11y): add Theme.is-high-contrast flag to gate HC-only borders
P4 foundation for the redundant-encoding accessibility pass. Adds a single flag that High-Contrast-only affordances (1px control borders, slider-thumb borders) read so they never leak into the polished normal themes, mirroring the existing is-system wiring. - qbz-theme: `pub fn is_high_contrast(id)` at the crate root next to `is_light` (true for HighContrast + HighContrastLight), with a unit test `high_contrast_flag_only_for_hc_themes` asserting exactly the two HC themes. - qbz-slint theme.slint: `in-out property <bool> is-high-contrast: false;` beside is-system; re-exported via semantic-colors.slint so all ~145 components get `Theme.is-high-contrast` with no per-file import change. Embedded the canonical HC border gate and the non-layout focus-ring snippet as a comment for the cluster agents to copy verbatim. - qbz-slint theme.rs: apply_theme sets it via `qbz_theme::is_high_contrast(id)`. cc
This commit is contained in:
3 files changed
+45
No files matched your search
@@ -97,6 +97,7 @@ pub fn apply_theme(window: &AppWindow, id: ThemeId) {
|
||||
let theme = window.global::<SlintTheme>();
|
||||
theme.set_c(to_slint(&colors));
|
||||
theme.set_is_system(id == ThemeId::System);
|
||||
theme.set_is_high_contrast(qbz_theme::is_high_contrast(id));
|
||||
log::info!("[qbz-slint] applied theme '{}'", id.slug());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user