pub enum ControlAttribute {
Show 14 variants
BoundingBox(Bounds),
ZIndex(u32),
Padding((u32, u32), (u32, u32)),
Text(Property),
FontAttr(Font),
StateAttr(State),
PopupAttr(Popup),
AppearanceAttr(Appearance),
ScrollAttr(Scroll),
Id(String),
SubComponents(Vec<Control>),
Controller(String),
Action(ActionTrigger, String),
Canvas(Resource<BindingCanvas>),
}Expand description
Attribute attached to a control
Variants§
BoundingBox(Bounds)
The bounding box for this control
ZIndex(u32)
Padding((u32, u32), (u32, u32))
Text(Property)
The text for this control
FontAttr(Font)
Specifies the font properties of this control
StateAttr(State)
Specifies the state of this control
PopupAttr(Popup)
Specifies the popup state of this control (meaningless if this is not a popup control)
AppearanceAttr(Appearance)
Specifies the appearance of this control
ScrollAttr(Scroll)
Specifies how the contents of this control will scroll
Id(String)
The unique ID for this control
SubComponents(Vec<Control>)
Subcomponents of this control
Controller(String)
Specifies the controller that manages the subcomponents of this control
Action(ActionTrigger, String)
When the specified action occurs for this item, send the event denoted by the string to the controller
Canvas(Resource<BindingCanvas>)
Specifies the canvas to use for this control (assuming it’s a canvas control)
Implementations§
Source§impl ControlAttribute
impl ControlAttribute
Sourcepub fn bounding_box<'a>(&'a self) -> Option<&'a Bounds>
pub fn bounding_box<'a>(&'a self) -> Option<&'a Bounds>
The bounding box represented by this attribute
Sourcepub fn padding(&self) -> Option<((u32, u32), (u32, u32))>
pub fn padding(&self) -> Option<((u32, u32), (u32, u32))>
The padding represented by this attribute
Sourcepub fn font<'a>(&'a self) -> Option<&'a Font>
pub fn font<'a>(&'a self) -> Option<&'a Font>
The font atrributes represented by this attribute
Sourcepub fn subcomponents<'a>(&'a self) -> Option<&'a Vec<Control>>
pub fn subcomponents<'a>(&'a self) -> Option<&'a Vec<Control>>
The subcomponent represented by this attribute
Sourcepub fn controller<'a>(&'a self) -> Option<&'a str>
pub fn controller<'a>(&'a self) -> Option<&'a str>
The controller represented by this attribute
Sourcepub fn action<'a>(&'a self) -> Option<(&'a ActionTrigger, &'a String)>
pub fn action<'a>(&'a self) -> Option<(&'a ActionTrigger, &'a String)>
The action represented by this attribute
Sourcepub fn state<'a>(&'a self) -> Option<&'a State>
pub fn state<'a>(&'a self) -> Option<&'a State>
The control state represented by this attribute
Sourcepub fn popup<'a>(&'a self) -> Option<&'a Popup>
pub fn popup<'a>(&'a self) -> Option<&'a Popup>
The popup attribute represented by this attribute
Sourcepub fn canvas<'a>(&'a self) -> Option<&'a Resource<BindingCanvas>>
pub fn canvas<'a>(&'a self) -> Option<&'a Resource<BindingCanvas>>
The canvas resource for this control, if there is one
Sourcepub fn appearance<'a>(&'a self) -> Option<&'a Appearance>
pub fn appearance<'a>(&'a self) -> Option<&'a Appearance>
The appearance assigned by this attribute, if there is one
Sourcepub fn scroll<'a>(&'a self) -> Option<&'a Scroll>
pub fn scroll<'a>(&'a self) -> Option<&'a Scroll>
The appearance assigned by this attribute, if there is one
Sourcepub fn is_different_flat(&self, compare_to: &ControlAttribute) -> bool
pub fn is_different_flat(&self, compare_to: &ControlAttribute) -> bool
Returns true if this attribute is different from another one (non-recursively, so this won’t check subcomoponents)
Trait Implementations§
Source§impl Clone for ControlAttribute
impl Clone for ControlAttribute
Source§fn clone(&self) -> ControlAttribute
fn clone(&self) -> ControlAttribute
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ControlAttribute
impl Debug for ControlAttribute
Source§impl Modifier<Control> for ControlAttribute
impl Modifier<Control> for ControlAttribute
Source§impl PartialEq for ControlAttribute
impl PartialEq for ControlAttribute
Source§fn eq(&self, other: &ControlAttribute) -> bool
fn eq(&self, other: &ControlAttribute) -> bool
self and other values to be equal, and is used by ==.