pub enum ControlSize {
Small,
Regular,
}Expand description
A control’s size — SwiftUI’s ControlSize. A closed pair, not a scale: the
two that ship are the row of a form and the chip on an overlay.
Variants§
Small
The chip: Callout on a control_radius corner.
Regular
The form row: Body on a button_radius corner.
Implementations§
Source§impl ControlSize
impl ControlSize
Sourcepub const fn height(self) -> f32
pub const fn height(self) -> f32
Height: the measured platform control, which Self::pad_y is then the
remainder of.
pub const fn pad_x(self) -> f32
Sourcepub const fn pad_y(self) -> f32
pub const fn pad_y(self) -> f32
What the height has left over its role’s line box, halved. Derived rather than stored: the pair drifted once already, when the line box moved off gpui’s phi and the two heights stayed where phi had put them.
pub fn radius(self) -> f32
Trait Implementations§
Source§impl Clone for ControlSize
impl Clone for ControlSize
Source§fn clone(&self) -> ControlSize
fn clone(&self) -> ControlSize
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 ControlSize
Source§impl Debug for ControlSize
impl Debug for ControlSize
impl Eq for ControlSize
Source§impl PartialEq for ControlSize
impl PartialEq for ControlSize
impl StructuralPartialEq for ControlSize
Auto Trait Implementations§
impl Freeze for ControlSize
impl RefUnwindSafe for ControlSize
impl Send for ControlSize
impl Sync for ControlSize
impl Unpin for ControlSize
impl UnsafeUnpin for ControlSize
impl UnwindSafe for ControlSize
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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