#[repr(C)]pub struct StyledNodeState {
pub hover: bool,
pub active: bool,
pub focused: bool,
pub disabled: bool,
pub checked: bool,
pub focus_within: bool,
pub visited: bool,
pub backdrop: bool,
pub dragging: bool,
pub drag_over: bool,
pub placeholder: bool,
pub seat_focused: bool,
}Expand description
NOTE: multiple states can be active at the same time
Tracks all CSS pseudo-class states for a node. Each flag is independent - a node can be both :hover and :focus simultaneously.
Fields§
§hover: boolElement is being hovered (:hover)
active: boolElement is active/being clicked (:active)
focused: boolElement has focus (:focus)
disabled: boolElement is disabled (:disabled)
checked: boolElement is checked/selected (:checked)
focus_within: boolElement or descendant has focus (:focus-within)
visited: boolLink has been visited (:visited)
backdrop: boolWindow is not focused (:backdrop) - GTK compatibility
dragging: boolElement is currently being dragged (:dragging)
drag_over: boolA dragged element is over this drop target (:drag-over)
placeholder: boolThe PROMPT of an empty editable is being styled (::placeholder).
A pseudo-ELEMENT rather than a state of the node: it is never set on
a real node during the cascade. The engine turns it on for the single
resolve that produces the prompt’s own style, so ::placeholder
rules travel the same bucketing/inheritance/lookup path as :hover
and :focus instead of needing storage of their own.
seat_focused: boolA NON-primary pointer seat focuses this node (:seat-focus,
9b-ii-a-i-d-iii-a). Independent of focused, which is the primary’s.
Implementations§
Source§impl StyledNodeState
impl StyledNodeState
Sourcepub const fn has_state(&self, state_type: u8) -> bool
pub const fn has_state(&self, state_type: u8) -> bool
Check if a specific pseudo-state is active
Sourcepub const fn from_pseudo_state_flags(flags: &PseudoStateFlags) -> Self
pub const fn from_pseudo_state_flags(flags: &PseudoStateFlags) -> Self
Create from PseudoStateFlags
Trait Implementations§
Source§impl Clone for StyledNodeState
impl Clone for StyledNodeState
Source§fn clone(&self) -> StyledNodeState
fn clone(&self) -> StyledNodeState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more