pub enum Attribute {
Show 32 variants
Alignment,
Background,
Borders,
Color,
Content,
Dataset,
Direction,
Disabled,
Display,
Focus,
FocusStyle,
Foreground,
Height,
HighlightedStr,
HighlightedColor,
InputLength,
InputType,
Layout,
Palette,
Rewind,
Shape,
Scroll,
ScrollStep,
Style,
Text,
TextAlign,
TextProps,
TextWrap,
Title,
Value,
Width,
Custom(&'static str),
}
Expand description
Describes a “selector” to query an attribute on props. The selector must identify uniquely an attribute in the properties. Check each attribute documentation to see how they’re supposed to be used, but remember that when implementing a component, you’re free to use each attribute as you prefer!
Variants§
Alignment
Layout alignment
Background
Background color or style
Borders
Borders styles
Color
Main color
Content
Component content. Generic purpose
Dataset
Dataset of component; should be associated to AttrValue::Dataset
Direction
Component layout direction
Disabled
Describes whether the component is disabled (e.g. an Input)
Display
Whether to display or not the component. This should be reserved to hide components.
As shown in stdlib and in example, its value should be AttrValue::Flag
and should be checked on top of the
view()
method to choose whether to or not to render the component.
Focus
Reserved for tracking focus on component.
You should not implement focus by yourself, since it’s already read/written by the active()
and blur()
methods on
view/application. When implementing a component, its value should be read-only.
The value is always AttrValue::Flag
FocusStyle
Should be used to use a different style from default when component is not enabled.
Foreground
Foreground color or style
Height
Height size. Useful when building layouts or containers
HighlightedStr
String to prepend to highlighted items in list or other
HighlightedColor
Color to apply to highlighted items
InputLength
Maximum input length for input fields
InputType
Input type for input fields
Layout
Defines a layout
Palette
A map of colors for complex components
Rewind
Intended to decide whether to rewind when reaching boundaries on list/tables
Shape
Intended to store a AttrValue::Shape
Scroll
Should be used to choose whether to make list interactive (scrollable) or not
ScrollStep
Intended as scroll step for fast scroll, for example when using PageUp
Style
Component style
Text
Component text content
TextAlign
Text align
TextProps
Text properties
TextWrap
Whether to wrap text (or how)
Title
Component box title
Value
A generic component value
Width
Component width; useful when using containers or layouts
Custom(&'static str)
A user defined property
Trait Implementations§
source§impl PartialEq for Attribute
impl PartialEq for Attribute
source§impl PartialOrd for Attribute
impl PartialOrd for Attribute
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more