FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SimpleTheme

    struct · ferroui-themes-simple · v0.5.0

    struct SimpleTheme
    

    The Simple theme: the styles and resources of SimpleTheme.xaml.

    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<SimpleTheme>
    

    Returns a strong reference to this object.

    Source

    DOCUMENT_URI

    const DOCUMENT_URI: &'static str
    

    The URI of the document of the class.

    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 (an exception of the constructor in the managed original).

    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.

    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.

    Panics

    Panics if the documents of the theme fail to load.

    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

    Trait implementations

    Availability

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