pub struct ListVisuals {
pub hovered: bool,
pub selected: bool,
pub active: bool,
pub interactive: bool,
pub strong: bool,
pub openness: Option<f32>,
}Expand description
Visual state information for list items with color computation methods
Fields§
§hovered: boolWhether the item is hovered
selected: boolWhether the item is selected
active: boolWhether the item is in active state (e.g., expanded)
interactive: boolWhether the item is interactive (clickable)
strong: boolWhether the text should be rendered with strong emphasis
openness: Option<f32>For collapsible items, the current openness (0.0 = closed, 1.0 = open)
Implementations§
Source§impl ListVisuals
impl ListVisuals
Sourcepub fn with_hovered(self, hovered: bool) -> Self
pub fn with_hovered(self, hovered: bool) -> Self
Set the hovered state
Sourcepub fn with_selected(self, selected: bool) -> Self
pub fn with_selected(self, selected: bool) -> Self
Set the selected state
Sourcepub fn with_active(self, active: bool) -> Self
pub fn with_active(self, active: bool) -> Self
Set the active state
Sourcepub fn with_interactive(self, interactive: bool) -> Self
pub fn with_interactive(self, interactive: bool) -> Self
Set the interactive state
Sourcepub fn with_strong(self, strong: bool) -> Self
pub fn with_strong(self, strong: bool) -> Self
Set the strong emphasis state
Sourcepub fn with_openness(self, openness: f32) -> Self
pub fn with_openness(self, openness: f32) -> Self
Set the openness for collapsible items
Sourcepub fn bg_color(&self, visuals: &Visuals) -> Option<Color32>
pub fn bg_color(&self, visuals: &Visuals) -> Option<Color32>
Compute background color based on state
Returns None if no background should be drawn (transparent).
Sourcepub fn text_color(&self, visuals: &Visuals) -> Color32
pub fn text_color(&self, visuals: &Visuals) -> Color32
Compute text color based on state
Sourcepub fn interactive_icon_tint(
&self,
icon_hovered: bool,
visuals: &Visuals,
) -> Color32
pub fn interactive_icon_tint( &self, icon_hovered: bool, visuals: &Visuals, ) -> Color32
Compute icon tint for interactive icons within list items
Use this for icons that have their own hover state (e.g., action buttons)
Sourcepub fn is_collapsible(&self) -> bool
pub fn is_collapsible(&self) -> bool
Check if this item is collapsible
Sourcepub fn is_collapsed(&self) -> bool
pub fn is_collapsed(&self) -> bool
Check if this item is collapsed (for collapsible items)
Sourcepub fn openness_value(&self) -> f32
pub fn openness_value(&self) -> f32
Get the current openness value (0.0 if not collapsible)
Trait Implementations§
Source§impl Clone for ListVisuals
impl Clone for ListVisuals
Source§fn clone(&self) -> ListVisuals
fn clone(&self) -> ListVisuals
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 ListVisuals
impl Debug for ListVisuals
Auto Trait Implementations§
impl Freeze for ListVisuals
impl RefUnwindSafe for ListVisuals
impl Send for ListVisuals
impl Sync for ListVisuals
impl Unpin for ListVisuals
impl UnsafeUnpin for ListVisuals
impl UnwindSafe for ListVisuals
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more