pub struct AccessibilityOverrides {
pub bold_text: Option<bool>,
pub high_contrast: Option<bool>,
pub disable_animations: Option<bool>,
pub invert_colors: Option<bool>,
pub accessible_navigation: Option<bool>,
pub always_use_24_hour_format: Option<bool>,
}Expand description
What an application wants to say about Accessibility instead of the platform,
one setting at a time.
Every field is an Option, and None is an answer: this application has no opinion,
use what the user’s system reports. That distinction is the whole point of the type.
A plain Accessibility cannot make it — a false there is indistinguishable from
silence, so an application that only wanted to force reduce motion would also be
telling the framework that its user does not use a screen reader.
It is the same shape, and the same reason, as
TextStyle against
ResolvedTextStyle: one type asks, the other answers.
fn accessibility(&self) -> AccessibilityOverrides {
// A settings screen with a "reduce motion" switch of its own. Everything else
// still comes from the platform.
AccessibilityOverrides::NONE.disable_animations(self.reduce_motion)
}Fields§
§bold_text: Option<bool>Override Accessibility::bold_text.
high_contrast: Option<bool>Override Accessibility::high_contrast.
disable_animations: Option<bool>Override Accessibility::disable_animations.
invert_colors: Option<bool>Override Accessibility::invert_colors.
Override Accessibility::accessible_navigation.
always_use_24_hour_format: Option<bool>Override Accessibility::always_use_24_hour_format.
Implementations§
Source§impl AccessibilityOverrides
impl AccessibilityOverrides
Sourcepub const fn bold_text(self, on: bool) -> Self
pub const fn bold_text(self, on: bool) -> Self
Speak for Accessibility::bold_text.
Sourcepub const fn high_contrast(self, on: bool) -> Self
pub const fn high_contrast(self, on: bool) -> Self
Speak for Accessibility::high_contrast.
Sourcepub const fn disable_animations(self, on: bool) -> Self
pub const fn disable_animations(self, on: bool) -> Self
Speak for Accessibility::disable_animations.
Sourcepub const fn invert_colors(self, on: bool) -> Self
pub const fn invert_colors(self, on: bool) -> Self
Speak for Accessibility::invert_colors.
Speak for Accessibility::accessible_navigation.
Sourcepub const fn always_use_24_hour_format(self, on: bool) -> Self
pub const fn always_use_24_hour_format(self, on: bool) -> Self
Speak for Accessibility::always_use_24_hour_format.