Skip to main content

Module style

Module style 

Source
Expand description

Style allows to change the visual appearance of widgets in a centralized manner. It can be considered as a storage for properties that define visual appearance. See Style docs for more info and usage examples.

Modules§

resource
Contains all types related to shared style resource.

Structs§

Style
Style is a simple container for a named properties. Styles can be based on some other styles, thus allowing cascaded styling. Such cascading allows to define some base style with common properties and then create any number of derived styles. For example, you can define a style for Button widget with corner radius, font size, border thickness and then create two derived styles for light and dark themes that will define colors and brushes. Light or dark theme does not affect all of those base properties, but has different colors.
StylePropertyContainer
Named style property container.
StyledProperty
A property, that can bind its value to a style. Why can’t we just fetch the actual value from the style and why do we need to store the value as well? The answer is flexibility. In this approach, style becomes not necessary and the value can be hardcoded. Also, the values of such properties can be updated individually.

Enums§

StyleProperty
A set of potential values for styled properties.

Statics§

DEFAULT_STYLE
Default style of the library.
LIGHT_STYLE
Light style of the library.

Traits§

IntoPrimitive
A trait that provides a method that translates StyleProperty into a specific primitive value.