pub struct PropertyContent { /* private fields */ }Expand description
Key-value pair content for displaying properties
§Example
ListItem::new()
.show(ui, PropertyContent::new("Price", "$1,234.56")
.value_color(Color32::GREEN));Implementations§
Source§impl PropertyContent
impl PropertyContent
Sourcepub fn new(label: impl Into<String>, value: impl Into<String>) -> Self
pub fn new(label: impl Into<String>, value: impl Into<String>) -> Self
Create new property content with label and value
Sourcepub fn value_color(self, color: Color32) -> Self
pub fn value_color(self, color: Color32) -> Self
Set a custom color for the value
Sourcepub fn label_width(self, width: f32) -> Self
pub fn label_width(self, width: f32) -> Self
Set a fixed width for the label column
Trait Implementations§
Source§impl ListItemContent for PropertyContent
impl ListItemContent for PropertyContent
Source§fn ui(self, ui: &mut Ui, context: &ContentContext<'_>) -> Response
fn ui(self, ui: &mut Ui, context: &ContentContext<'_>) -> Response
Paint the content inside
context.rect and return the row response.Source§fn interactive(&self) -> bool
fn interactive(&self) -> bool
Whether the row reacts to the pointer. Disabled content returns
false.Auto Trait Implementations§
impl Freeze for PropertyContent
impl RefUnwindSafe for PropertyContent
impl Send for PropertyContent
impl Sync for PropertyContent
impl Unpin for PropertyContent
impl UnsafeUnpin for PropertyContent
impl UnwindSafe for PropertyContent
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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