feat(engine): reduce-transparency + high-contrast support for glass chrome
New Settings::reduce_transparency_mode (serde-default, Accessibility toggle row) swaps every GlassSurface's gradients for a flat opaque BG_ELEVATED fill; high-contrast mode now also boosts the glass fill opacity and rim luminance to BORDER_SUBTLE_HC levels. Both applied by settings_plugin::update_glass_surfaces, which retargets the gradients in place on toggle or on newly spawned glass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -135,6 +135,10 @@ struct HighContrastText;
|
||||
#[derive(Component, Debug)]
|
||||
struct ReduceMotionText;
|
||||
|
||||
/// Marks the `Text` node showing the current reduce-transparency state.
|
||||
#[derive(Component, Debug)]
|
||||
struct ReduceTransparencyText;
|
||||
|
||||
/// Marks the `Text` node showing the current touch input mode state.
|
||||
#[derive(Component, Debug)]
|
||||
struct TouchInputModeText;
|
||||
@@ -277,6 +281,10 @@ enum SettingsButton {
|
||||
/// non-essential motion (card-slide animations become instant
|
||||
/// snaps) per `design-system.md` §Accessibility (#3).
|
||||
ToggleReduceMotion,
|
||||
/// Toggle the [`Settings::reduce_transparency_mode`] flag — swaps
|
||||
/// translucent glass chrome (the floating touch tab bar) for opaque
|
||||
/// fills so table content never bleeds through UI text.
|
||||
ToggleReduceTransparency,
|
||||
/// Toggle [`Settings::touch_input_mode`] between `OneTap`
|
||||
/// (auto-move on tap, default) and `TapToSelect` (first tap selects
|
||||
/// a card/stack, second tap on a target pile moves it).
|
||||
@@ -361,8 +369,9 @@ impl SettingsButton {
|
||||
// run before continuing to the picker rows.
|
||||
SettingsButton::ToggleHighContrast => 61,
|
||||
SettingsButton::ToggleReduceMotion => 62,
|
||||
SettingsButton::ToggleTouchInputMode => 63,
|
||||
SettingsButton::CycleUiScale => 64,
|
||||
SettingsButton::ToggleReduceTransparency => 63,
|
||||
SettingsButton::ToggleTouchInputMode => 64,
|
||||
SettingsButton::CycleUiScale => 65,
|
||||
// Picker rows — every swatch in a row shares the row's
|
||||
// priority so entity-index tiebreaking yields left → right.
|
||||
SettingsButton::SelectCardBack(_) => 70,
|
||||
@@ -514,6 +523,16 @@ impl Plugin for SettingsPlugin {
|
||||
update_smart_default_size_text,
|
||||
),
|
||||
);
|
||||
app.add_systems(
|
||||
Update,
|
||||
(
|
||||
update_reduce_transparency_text,
|
||||
// Guards internally on settings-change / newly added
|
||||
// glass — `Added<GlassSurface>` can't be expressed as
|
||||
// a resource run condition.
|
||||
update_glass_surfaces,
|
||||
),
|
||||
);
|
||||
app.add_systems(
|
||||
Update,
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user