#[repr(C)]pub struct SystemStyle {Show 22 fields
pub theme: Theme,
pub platform: Platform,
pub os_version: OsVersion,
pub colors: SystemColors,
pub fonts: SystemFonts,
pub metrics: SystemMetrics,
pub language: AzString,
pub prefers_reduced_motion: BoolCondition,
pub prefers_high_contrast: BoolCondition,
pub app_specific_stylesheet: Option<Box<Stylesheet>>,
pub icon_style: IconStyleOptions,
pub scrollbar: Option<Box<ComputedScrollbarStyle>>,
pub accessibility: AccessibilitySettings,
pub input: InputMetrics,
pub text_rendering: TextRenderingHints,
pub focus_visuals: FocusVisuals,
pub scrollbar_preferences: ScrollbarPreferences,
pub linux: LinuxCustomization,
pub visual_hints: VisualHints,
pub animation: AnimationMetrics,
pub audio: AudioMetrics,
pub scroll_physics: ScrollPhysics,
}Expand description
A unified collection of discovered system style properties.
Fields§
§theme: Theme§platform: Platform§os_version: OsVersionDetected OS version (e.g., Windows 11 22H2, macOS Sonoma, etc.)
colors: SystemColors§fonts: SystemFonts§metrics: SystemMetrics§language: AzStringSystem language/locale in BCP 47 format (e.g., “en-US”, “de-DE”) Detected from OS settings at startup
prefers_reduced_motion: BoolConditionUser prefers reduced motion (accessibility setting)
prefers_high_contrast: BoolConditionUser prefers high contrast (accessibility setting)
app_specific_stylesheet: Option<Box<Stylesheet>>An optional, user-provided stylesheet loaded from a conventional
location (~/.config/azul/styles/<app_name>.css), allowing for
application-specific “ricing”. This is only loaded when the “io”
feature is enabled and not disabled by the AZUL_DISABLE_RICING env var.
icon_style: IconStyleOptionsIcon-specific styling options (grayscale, tinting, etc.)
scrollbar: Option<Box<ComputedScrollbarStyle>>Scrollbar style information (boxed to ensure stable FFI size)
accessibility: AccessibilitySettingsDetailed accessibility settings (superset of prefers_reduced_motion / prefers_high_contrast)
input: InputMetricsInput interaction timing / distance thresholds from the OS
text_rendering: TextRenderingHintsText rendering / anti-aliasing hints from the OS
focus_visuals: FocusVisualsFocus ring / indicator visual style
scrollbar_preferences: ScrollbarPreferencesOS-level scrollbar visibility / click-behaviour preferences
linux: LinuxCustomizationLinux-specific customisation (icon theme, cursor theme, GTK theme, …)
visual_hints: VisualHintsVisual hints: icons in menus/buttons, toolbar style, tooltips
animation: AnimationMetricsAnimation enable/disable, speed factor, focus indicator behaviour
audio: AudioMetricsAudio feedback preferences (event sounds, input sounds)
scroll_physics: ScrollPhysicsGlobal scroll physics configuration (momentum, friction, rubber-banding). Platform-specific defaults are applied during system style discovery. Applications can override this to change the “feel” of scrolling globally.
Implementations§
Source§impl SystemStyle
impl SystemStyle
Sourcepub fn to_json_string(&self) -> AzString
pub fn to_json_string(&self) -> AzString
Format the SystemStyle as a human-readable JSON string for debugging.
This does NOT use serde — it manually formats the most important fields so that they can be verified against OS-reported values in a test script.
Sourcepub fn detect() -> Self
pub fn detect() -> Self
Discovers the system’s UI style, and loads an optional app-specific stylesheet.
If the “io” feature is enabled, this function may be slow as it can involve running external commands and reading files.
If the “io” feature is disabled, this returns a hard-coded, deterministic style based on the target operating system.
Sourcepub fn create_csd_stylesheet(&self) -> Stylesheet
pub fn create_csd_stylesheet(&self) -> Stylesheet
Create a CSS stylesheet for CSD (Client-Side Decorations) titlebar
This generates CSS rules for the CSD titlebar using system colors, fonts, and metrics to match the native platform look.
Trait Implementations§
Source§impl Clone for SystemStyle
impl Clone for SystemStyle
Source§fn clone(&self) -> SystemStyle
fn clone(&self) -> SystemStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more