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>>) -> Self
Sourcepub fn uv(self, uv: impl Into<Rect>) -> Self
 
pub fn uv(self, uv: impl Into<Rect>) -> Self
Select UV range. Default is (0,0) in top-left, (1,1) bottom right.
Sourcepub fn tint(self, tint: impl Into<Color32>) -> Self
 
pub fn tint(self, tint: impl Into<Color32>) -> Self
Multiply image color with this. Default is WHITE (no tint).
Sourcepub fn sense(self, sense: Sense) -> Self
 
pub fn sense(self, sense: Sense) -> Self
By default, buttons senses clicks.
Change this to a drag-button with Sense::drag().
Sourcepub fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self
 
pub fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self
Set rounding for the ImageButton.
If the underlying image already has rounding, this will override that value.
Sourcepub fn rounding(self, corner_radius: impl Into<CornerRadius>) -> Self
 👎Deprecated: Renamed to corner_radius
pub fn rounding(self, corner_radius: impl Into<CornerRadius>) -> Self
corner_radiusSet 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