pub struct IconButtonSpec {
pub enabled: bool,
pub touch_target: f32,
pub colors: IconButtonColors,
}Expand description
How an icon button behaves and looks.
Fields§
§enabled: boolWhether the button accepts input. A disabled button still publishes itself to a screen reader, which is how the user learns it exists.
touch_target: f32The square the pointer target occupies, never smaller than
MINIMUM_TOUCH_TARGET.
colors: IconButtonColorsThe surfaces the button paints.
Implementations§
Source§impl IconButtonSpec
impl IconButtonSpec
Sourcepub const fn with_enabled(self, enabled: bool) -> Self
pub const fn with_enabled(self, enabled: bool) -> Self
Sets whether the button accepts input.
Sourcepub fn with_touch_target(self, size: f32) -> Self
pub fn with_touch_target(self, size: f32) -> Self
Sets the pointer target size. Values below MINIMUM_TOUCH_TARGET are
raised to it: a control smaller than that is a control people miss.
Sourcepub const fn with_colors(self, colors: IconButtonColors) -> Self
pub const fn with_colors(self, colors: IconButtonColors) -> Self
Sets the surfaces.
Sourcepub fn resolved_touch_target(&self) -> f32
pub fn resolved_touch_target(&self) -> f32
The target size this spec actually uses.
Trait Implementations§
Source§impl Clone for IconButtonSpec
impl Clone for IconButtonSpec
Source§fn clone(&self) -> IconButtonSpec
fn clone(&self) -> IconButtonSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for IconButtonSpec
Source§impl Debug for IconButtonSpec
impl Debug for IconButtonSpec
Source§impl Default for IconButtonSpec
impl Default for IconButtonSpec
Source§impl PartialEq for IconButtonSpec
impl PartialEq for IconButtonSpec
impl StructuralPartialEq for IconButtonSpec
Auto Trait Implementations§
impl Freeze for IconButtonSpec
impl RefUnwindSafe for IconButtonSpec
impl Send for IconButtonSpec
impl Sync for IconButtonSpec
impl Unpin for IconButtonSpec
impl UnsafeUnpin for IconButtonSpec
impl UnwindSafe for IconButtonSpec
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