pub struct Label { /* private fields */ }Implementations§
Source§impl Label
impl Label
Sourcepub fn new(text: impl Into<WidgetText>, image: Option<Image<'static>>) -> Self
pub fn new(text: impl Into<WidgetText>, image: Option<Image<'static>>) -> Self
Create a new Label with text and an optional image.
By default the image is shown after the text
pub fn expand(self, expansion: Option<f32>) -> Self
Sourcepub fn sense(self, sense: Sense) -> Self
pub fn sense(self, sense: Sense) -> Self
Make the label respond to clicks and/or drags.
This will also turn the selectable to false
Sourcepub fn interactive(self, interactive: bool) -> Self
pub fn interactive(self, interactive: bool) -> Self
Make the label interactive
True by default, If false on hover/click there will be no bg color
pub fn wrap_mode(self, wrap_mode: TextWrapMode) -> Self
pub fn wrap(self) -> Self
Sourcepub fn selectable(self, selectable: bool) -> Self
pub fn selectable(self, selectable: bool) -> Self
Set whether the text can be selected with the mouse.
Sourcepub fn image_on_left(self) -> Self
pub fn image_on_left(self) -> Self
Show the image first and then the text
pub fn selected(self, selected: bool) -> Self
pub fn fill_width(self, fill: bool) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Label
impl RefUnwindSafe for Label
impl Send for Label
impl Sync for Label
impl Unpin for Label
impl UnwindSafe for Label
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