#[repr(C)]pub struct SystemStyle {Show 22 fields
pub fonts: SystemFonts,
pub metrics: SystemMetrics,
pub linux: LinuxCustomization,
pub platform: Platform,
pub focus_visuals: FocusVisuals,
pub language: AzString,
pub app_specific_stylesheet: Option<Box<Css>>,
pub scrollbar: Option<Box<ComputedScrollbarStyle>>,
pub scroll_physics: ScrollPhysics,
pub theme: Theme,
pub os_version: OsVersion,
pub prefers_reduced_motion: BoolCondition,
pub prefers_high_contrast: BoolCondition,
pub accessibility: AccessibilitySettings,
pub input: InputMetrics,
pub text_rendering: TextRenderingHints,
pub scrollbar_preferences: ScrollbarPreferences,
pub visual_hints: VisualHints,
pub animation: AnimationMetrics,
pub colors: SystemColors,
pub icon_style: IconStyleOptions,
pub audio: AudioMetrics,
}Expand description
A unified collection of discovered system style properties.
Fields§
§fonts: SystemFonts§metrics: SystemMetrics§linux: LinuxCustomizationLinux-specific customisation (icon theme, cursor theme, GTK theme, …)
platform: Platform§focus_visuals: FocusVisualsFocus ring / indicator visual style
language: AzStringSystem language/locale in BCP 47 format (e.g., “en-US”, “de-DE”) Detected from OS settings at startup
app_specific_stylesheet: Option<Box<Css>>An optional, user-provided stylesheet loaded from a conventional
location (~/.config/azul/styles/<app_name>.css), allowing for
application-specific “ricing”. Only loaded when the “io” feature
is enabled and AZ_RICING is not set to off.
scrollbar: Option<Box<ComputedScrollbarStyle>>Scrollbar style information (boxed to ensure stable FFI size)
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.
theme: Theme§os_version: OsVersionDetected OS version (e.g., Windows 11 22H2, macOS Sonoma, etc.)
prefers_reduced_motion: BoolConditionUser prefers reduced motion (accessibility setting)
prefers_high_contrast: BoolConditionUser prefers high contrast (accessibility setting)
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
scrollbar_preferences: ScrollbarPreferencesOS-level scrollbar visibility / click-behaviour preferences
visual_hints: VisualHintsVisual hints: icons in menus/buttons, toolbar style, tooltips
animation: AnimationMetricsAnimation enable/disable, speed factor, focus indicator behaviour
colors: SystemColors§icon_style: IconStyleOptionsIcon-specific styling options (grayscale, tinting, etc.)
audio: AudioMetricsAudio feedback preferences (event sounds, input sounds)
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
Returns a platform-appropriate default system style.
This returns hard-coded defaults based on the target OS. For actual
runtime detection of the user’s theme, colors, and fonts, use the
platform discovery in azul-dll (called automatically by App::create()).
Sourcepub fn default_for_platform() -> Self
pub fn default_for_platform() -> Self
Returns hard-coded defaults for the current compile-time platform.
Sourcepub fn create_csd_stylesheet(&self) -> Css
pub fn create_csd_stylesheet(&self) -> Css
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. Returned rules
carry rule_priority::SYSTEM.
Trait Implementations§
Source§impl Clone for SystemStyle
impl Clone for SystemStyle
Source§fn clone(&self) -> SystemStyle
fn clone(&self) -> SystemStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SystemStyle
impl Debug for SystemStyle
Source§impl Default for SystemStyle
impl Default for SystemStyle
Source§fn default() -> SystemStyle
fn default() -> SystemStyle
Source§impl PartialEq for SystemStyle
impl PartialEq for SystemStyle
Source§fn eq(&self, other: &SystemStyle) -> bool
fn eq(&self, other: &SystemStyle) -> bool
self and other values to be equal, and is used by ==.