pub struct ColorSwatch {
pub fill: Color,
pub label: String,
pub font: FontChoice,
pub opt: WidgetOption,
pub bopt: WidgetBehaviourOption,
}Expand description
Non-interactive filled rectangle used for retained preview swatches.
Fields§
§fill: ColorFill color rendered inside the swatch.
label: StringOptional label rendered on top of the swatch.
font: FontChoiceFont selection used for the label.
opt: WidgetOptionWidget options applied to the swatch.
bopt: WidgetBehaviourOptionBehaviour options applied to the swatch.
Implementations§
Trait Implementations§
Source§impl Clone for ColorSwatch
impl Clone for ColorSwatch
Source§fn clone(&self) -> ColorSwatch
fn clone(&self) -> ColorSwatch
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 Widget for ColorSwatch
impl Widget for ColorSwatch
Source§fn widget_opt(&self) -> &WidgetOption
fn widget_opt(&self) -> &WidgetOption
Returns the widget options for this state.
Source§fn behaviour_opt(&self) -> &WidgetBehaviourOption
fn behaviour_opt(&self) -> &WidgetBehaviourOption
Returns the behaviour options for this state.
Source§fn measure(
&self,
style: &Style,
atlas: &AtlasHandle,
avail: Dimensioni,
) -> Dimensioni
fn measure( &self, style: &Style, atlas: &AtlasHandle, avail: Dimensioni, ) -> Dimensioni
Returns the intrinsic widget size for the current frame’s layout pass. Read more
Source§fn run(
&mut self,
ctx: &mut WidgetCtx<'_>,
control: &ControlState,
) -> ResourceState
fn run( &mut self, ctx: &mut WidgetCtx<'_>, control: &ControlState, ) -> ResourceState
Runs the widget for the current frame and returns the current frame result.
Source§fn effective_widget_opt(&self) -> WidgetOption
fn effective_widget_opt(&self) -> WidgetOption
Returns the effective widget options used by generic dispatch. Read more
Source§fn effective_behaviour_opt(&self) -> WidgetBehaviourOption
fn effective_behaviour_opt(&self) -> WidgetBehaviourOption
Returns the effective behavior options used by generic dispatch.
Source§fn needs_input_snapshot(&self) -> bool
fn needs_input_snapshot(&self) -> bool
Returns whether this widget needs per-frame input snapshots.
Auto Trait Implementations§
impl Freeze for ColorSwatch
impl RefUnwindSafe for ColorSwatch
impl Send for ColorSwatch
impl Sync for ColorSwatch
impl Unpin for ColorSwatch
impl UnsafeUnpin for ColorSwatch
impl UnwindSafe for ColorSwatch
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