|
CeresEngine 0.2.0
A game development framework
|
A UI appearance property that returns a color. More...
#include <CeresEngine/UI/UIAppearance.hpp>
Public Types | |
| using | DefaultValueFunction = UniqueFunction< T(const UIView &) const > |
| A function that computes a default value. | |
| using | DefaultValueVariant = Variant< T, DefaultValueFunction, const UIAppearanceProperty * > |
| A variant type that represents the default value. | |
Public Member Functions | |
| UIAppearanceProperty (const StringView &name, const T &defaultValue=T()) | |
Creates a new UIAppearanceProperty. | |
| UIAppearanceProperty (const StringView &name, DefaultValueFunction &&defaultValueFunction) | |
Creates a new UIAppearanceProperty by using a computation function. | |
| UIAppearanceProperty (const StringView &name, const UIAppearanceProperty &aliasedProperty) | |
Creates a new UIAppearanceProperty by aliasing another property. | |
| T | getDefaultValue (const UIView &aView) const noexcept |
| Gets the default value for the property. | |
| T | operator[] (const UIView &view) const noexcept |
Computes the appearance property value for the given view. | |
| T | operator[] (const UIView *const aView) const noexcept |
Public Attributes | |
| StringView | name |
| A name for the appearance property. | |
| DefaultValueVariant | defaultValue |
| The properties default value, to be used in case the appearance don't offer a custom value. | |
A UI appearance property that returns a color.
| T | The appearance property value type. |
| using CeresEngine::UIAppearanceProperty< T >::DefaultValueFunction = UniqueFunction<T(const UIView&) const> |
A function that computes a default value.
| using CeresEngine::UIAppearanceProperty< T >::DefaultValueVariant = Variant<T, DefaultValueFunction, const UIAppearanceProperty*> |
A variant type that represents the default value.
|
inlineexplicit |
Creates a new UIAppearanceProperty.
| name | The property name. |
| defaultValue | The property default value. |
|
inlineexplicit |
Creates a new UIAppearanceProperty by using a computation function.
| name | The property name. |
| defaultValueFunction | The function to be used to compute the property default value. |
|
inlineexplicit |
Creates a new UIAppearanceProperty by aliasing another property.
| name | The property name. |
| aliasedProperty | The property to alias as the default value. |
|
noexcept |
Gets the default value for the property.
| appearance | The UIAppearance to be forwarded to the DefaultValueFunction. |
|
noexcept |
Computes the appearance property value for the given view.
| view | The view to compute the appearance property for. |
|
inlinenoexcept |
| DefaultValueVariant CeresEngine::UIAppearanceProperty< T >::defaultValue |
The properties default value, to be used in case the appearance don't offer a custom value.
| StringView CeresEngine::UIAppearanceProperty< T >::name |
A name for the appearance property.
Used to uniquely identify a property in the appearance map.