#[repr(C)]pub enum SystemStyleDependency {
Theme = 0,
Colors = 1,
Fonts = 2,
Metrics = 3,
Icons = 4,
Accessibility = 5,
Everything = 6,
}Expand description
Which facet of the OS style a layout() callback read.
An “appearance change” is never one event. The light/dark polarity flips,
or the accent colour moves, or the UI font grows, or the icon theme is
swapped — and each of those reaches a different app differently. Whether
the change can alter what layout() RETURNS depends entirely on what that
callback read, and only the callback knows.
LayoutCallbackInfo::depends_on_system_style is how it says so; this
enum is the vocabulary.
Deliberately coarse. The distinction that pays is between the app that
merely mirrors light/dark (its DOM is byte-identical across two different
LIGHT schemes, so an accent change must not cost it a rebuild) and the app
that baked colors.button_face into inline CSS inside layout() (its DOM
is wrong the instant the palette moves). Finer facets would be more
precise and nobody would declare them correctly.
Variants§
Theme = 0
The light/dark polarity alone — LayoutCallbackInfo::get_theme.
Colors = 1
The colour palette: text, background, accent, button, selection.
Fonts = 2
The UI fonts — family, size, weight.
Metrics = 3
Sizing and spacing metrics: control sizes, scrollbar geometry, titlebar layout, input timings, focus ring.
Icons = 4
The icon theme and the icon styling options.
Accessibility = 5
Accessibility and motion preferences — reduced motion, high contrast, animation speed.
Everything = 6
Everything: the callback took the whole SystemStyle and the engine
cannot see which parts of it were read. The conservative answer, and
what LayoutCallbackInfo::get_system_style records.
Implementations§
Source§impl SystemStyleDependency
impl SystemStyleDependency
Sourcepub const fn bit(self) -> u32
pub const fn bit(self) -> u32
This facet’s bit in a SystemStyleDependencies mask.
Trait Implementations§
Source§impl Clone for SystemStyleDependency
impl Clone for SystemStyleDependency
Source§fn clone(&self) -> SystemStyleDependency
fn clone(&self) -> SystemStyleDependency
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more