pub struct ImageButton<'a> { /* private fields */ }Expand description
A clickable image within a frame.
Implementations§
Source§impl<'a> ImageButton<'a>
impl<'a> ImageButton<'a>
pub fn new(image: impl Into<Image<'a>>) -> ImageButton<'a>
Sourcepub fn uv(self, uv: impl Into<Rect>) -> ImageButton<'a>
pub fn uv(self, uv: impl Into<Rect>) -> ImageButton<'a>
Select UV range. Default is (0,0) in top-left, (1,1) bottom right.
Sourcepub fn tint(self, tint: impl Into<Color32>) -> ImageButton<'a>
pub fn tint(self, tint: impl Into<Color32>) -> ImageButton<'a>
Multiply image color with this. Default is WHITE (no tint).
Sourcepub fn selected(self, selected: bool) -> ImageButton<'a>
pub fn selected(self, selected: bool) -> ImageButton<'a>
If true, mark this button as “selected”.
Sourcepub fn frame(self, frame: bool) -> ImageButton<'a>
pub fn frame(self, frame: bool) -> ImageButton<'a>
Turn off the frame
Sourcepub fn sense(self, sense: Sense) -> ImageButton<'a>
pub fn sense(self, sense: Sense) -> ImageButton<'a>
By default, buttons senses clicks.
Change this to a drag-button with Sense::drag().
Sourcepub fn rounding(self, rounding: impl Into<Rounding>) -> ImageButton<'a>
pub fn rounding(self, rounding: impl Into<Rounding>) -> ImageButton<'a>
Set rounding for the ImageButton.
If the underlying image already has rounding, this
will override that value.
Trait Implementations§
Source§impl<'a> Clone for ImageButton<'a>
impl<'a> Clone for ImageButton<'a>
Source§fn clone(&self) -> ImageButton<'a>
fn clone(&self) -> ImageButton<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ImageButton<'a>
impl<'a> Debug for ImageButton<'a>
Auto Trait Implementations§
impl<'a> Freeze for ImageButton<'a>
impl<'a> RefUnwindSafe for ImageButton<'a>
impl<'a> Send for ImageButton<'a>
impl<'a> Sync for ImageButton<'a>
impl<'a> Unpin for ImageButton<'a>
impl<'a> UnwindSafe for ImageButton<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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