FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IPlatformSettings

    trait · ferroui-base · v0.5.0

    trait IPlatformSettings
    

    A platform-specific settings contract.

    This interface is not meant to be implemented by applications.

    View source

    Members

    get_tap_size

    fn get_tap_size(self: &Self, type_: PointerType) -> Size
    

    The size of the rectangle around the location of a pointer down that a pointer up must occur within in order to register a tap gesture, in device-independent pixels.

    Source

    get_double_tap_size

    fn get_double_tap_size(self: &Self, type_: PointerType) -> Size
    

    The size of the rectangle around the location of a pointer down that a pointer up must occur within in order to register a double-tap gesture, in device-independent pixels.

    Source

    get_double_tap_time

    fn get_double_tap_time(self: &Self, type_: PointerType) -> Duration
    

    The maximum time that may occur between the first and second click of a double-tap gesture.

    Source

    hold_wait_duration

    fn hold_wait_duration(self: &Self) -> Duration
    

    The time a pointer must be held down for in order to register a holding gesture.

    Source

    hotkey_configuration

    fn hotkey_configuration(self: &Self) -> Rc<PlatformHotkeyConfiguration>
    

    The key gestures of the platform for common commands.

    Source

    preferred_application_language

    fn preferred_application_language(self: &Self) -> String
    

    The preferred application language of the user: the tag of the language (such as en-US) the platform reports for the application.

    Source

    animations_enabled

    fn animations_enabled(self: &Self) -> bool
    

    Whether the user lets the system play animations that are not essential (WinUI SharedHelpers::IsAnimationsEnabled, which reads UISettings.AnimationsEnabled).

    The setting is asked for each animation, not kept: a change of it applies to the next animation. A platform that does not report it lets animations play (the default). A FerroUI addition for the ports of WinUI controls (DEVIATIONS.md, Platform settings).

    Source

    transparency_enabled

    fn transparency_enabled(self: &Self) -> bool
    

    Whether the system permits translucent materials and backdrop effects.

    A backend that does not expose a transparency preference preserves the application's normal materials. Backends should query the current preference rather than cache it for the process lifetime.

    Source

    accessibility_settings_changed

    fn accessibility_settings_changed(self: &Self, _handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
    

    Raised when motion, transparency, or other display accessibility preferences change. The callback runs on the UI thread; consumers read the current values and invalidate any derived resources.

    The default is an empty subscription so existing platform backends and external implementations remain source-compatible.

    Source

    get_color_values

    fn get_color_values(self: &Self) -> PlatformColorValues
    

    Gets current system color values including dark mode and accent colors.

    Source

    color_values_changed

    fn color_values_changed(self: &Self, handler: Rc<dyn Fn(&PlatformColorValues) -> ()>) -> Rc<dyn IDisposable>
    

    Raises when current system color values are changed, including changing of a dark mode and accent colors. Disposing the returned handle unsubscribes.

    Source

    preferred_application_language_changed

    fn preferred_application_language_changed(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
    

    Raised when the system language preferences change. Disposing the returned handle unsubscribes.

    Source

    energy_saver_enabled

    fn energy_saver_enabled(self: &Self) -> bool
    

    Whether the energy saver of the system (battery saver, low power mode) is on: WinUI's material policy (MaterialHelper) draws no acrylic while it is, from PowerManager.EnergySaverStatus. A platform that does not report it answers false. Backends should query the current state rather than cache it for the process lifetime. A FerroUI addition (docs/porting/winui-materials.md).

    Source

    energy_saver_changed

    fn energy_saver_changed(self: &Self, _handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
    

    Raised when the energy saver is turned on or off. The callback runs on the UI thread; consumers read energy_saver_enabled. The default is an empty subscription, for platforms that do not report it.

    Source

    Trait implementations

    Availability

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