FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MacOSTheme

    struct · ferroui-themes-macos · v0.5.0

    struct MacOSTheme
    

    Includes the macOS 26 theme in an application.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<MacOSTheme>
    

    Returns a strong reference to this object.

    Source

    control_size_property

    fn control_size_property() -> &'static DirectProperty<MacOSTheme, ControlSize>
    

    Source

    reduce_motion_property

    fn reduce_motion_property() -> &'static DirectProperty<MacOSTheme, bool>
    

    Source

    reduce_transparency_property

    fn reduce_transparency_property() -> &'static DirectProperty<MacOSTheme, bool>
    

    Source

    increase_contrast_property

    fn increase_contrast_property() -> &'static DirectProperty<MacOSTheme, bool>
    

    Source

    window_active_property

    fn window_active_property() -> &'static DirectProperty<MacOSTheme, bool>
    

    Source

    accent_color_property

    fn accent_color_property() -> &'static DirectProperty<MacOSTheme, Option<Color>>
    

    Source

    density_style_property

    fn density_style_property() -> &'static DirectProperty<MacOSTheme, DensityStyle>
    

    Defines the DensityStyle property.

    Source

    DOCUMENT_URI

    const DOCUMENT_URI: &'static str
    

    The URI of the document of the class.

    Source

    high_contrast

    fn high_contrast() -> ThemeVariant
    

    Optional dark high-contrast variant. For increased contrast without changing appearance, set IncreaseContrast and keep the light/dark requested variant.

    Source

    construct

    fn construct() -> Self
    

    Field initialisation; see Styles::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Creates the theme.

    Panics

    Panics if the documents of the theme fail to load.

    Source

    with_service_provider

    fn with_service_provider(sp: Option<Rc<dyn IServiceProvider>>) -> Ref<Self>
    

    Creates the theme; sp is the parent's service provider.

    The full theme: every unit of its compiled markup. A later load of the theme by URI gets the full theme too, unless the application registered the units it keeps.

    Panics

    Panics if the documents of the theme fail to load, or if the loaded document lacks the compact styles.

    Source

    with_parts

    fn with_parts(sp: Option<Rc<dyn IServiceProvider>>, parts: rt::ThemeParts) -> Ref<Self>
    

    Creates the theme from some of the units of its compiled markup (#568, step 3 of docs/porting/theme-trimming.md); sp is the parent's service provider.

    parts are units of crate::compiled_xaml::THEME_UNITS, in canonical order (ascending indices), with the ambient unit (index 0) first: the table an application's build writes when it trims its themes (the default; [package.metadata.ferroui] theme-trimming = false turns it off). The theme applies those units, at the places of the full theme and in its order; a unit that parts leaves out adds nothing. Only the units named are linked into the application. In debug builds a lookup of a control theme that parts left out logs once that it was trimmed.

    Panics

    Panics if the documents of the theme fail to load, or if parts leaves out the ambient unit (index 0), which has the structure of the theme.

    Source

    density_style

    fn density_style(self: &Self) -> DensityStyle
    

    The density style of the theme (normal, compact).

    Source

    set_density_style

    fn set_density_style(self: &Self, value: DensityStyle)
    

    Source

    control_size

    fn control_size(self: &Self) -> ControlSize
    

    Source

    set_control_size

    fn set_control_size(self: &Self, value: ControlSize)
    

    Source

    reduce_motion

    fn reduce_motion(self: &Self) -> bool
    

    Source

    set_reduce_motion

    fn set_reduce_motion(self: &Self, value: bool)
    

    Source

    reduce_transparency

    fn reduce_transparency(self: &Self) -> bool
    

    Source

    set_reduce_transparency

    fn set_reduce_transparency(self: &Self, value: bool)
    

    Source

    increase_contrast

    fn increase_contrast(self: &Self) -> bool
    

    Source

    set_increase_contrast

    fn set_increase_contrast(self: &Self, value: bool)
    

    Source

    window_active

    fn window_active(self: &Self) -> bool
    

    Applications hosting more than one window can install a theme per window and bind this property to the window's activation state.

    Source

    set_window_active

    fn set_window_active(self: &Self, value: bool)
    

    Source

    accent_color

    fn accent_color(self: &Self) -> Option<Color>
    

    None follows the platform accent; setting a color overrides it for this theme.

    Source

    set_accent_color

    fn set_accent_color(self: &Self, value: Option<Color>)
    

    Source

    effective_reduce_motion

    fn effective_reduce_motion(self: &Self) -> bool
    

    Whether nonessential motion is disabled by this theme or the platform.

    Source

    effective_reduce_transparency

    fn effective_reduce_transparency(self: &Self) -> bool
    

    Whether glass must use the opaque fallback, including the system preference.

    Source

    effective_increase_contrast

    fn effective_increase_contrast(self: &Self) -> bool
    

    Increased contrast preserves the selected light or dark appearance.

    Source

    try_get_resource

    fn try_get_resource(self: &Self, key: &ResourceKey, theme: Option<&ThemeVariant>) -> Option<ResourceValue>
    

    Tries to find a resource within the theme: the compact resources are checked first when the density style is compact.

    Source

    as_style

    fn as_style(self: &Self) -> Rc<dyn IStyle>
    

    The theme as a style, for the style collections of applications and elements (application.styles().add(theme.as_style())).

    Source

    as_resource_provider

    fn as_resource_provider(self: &Self) -> Rc<dyn IResourceProvider>
    

    The theme as a resource provider.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.