pub struct ColorPickerStyle {
pub base: PickerBaseStyle,
pub popup_width: f32,
pub popup_height: f32,
pub swatch_size: f32,
}Expand description
HSV plane, hue rail, swatch, and hex popup geometry.
§Examples
use ailloli_ui_widgets::controls::ColorPickerStyle;
let style = ColorPickerStyle::default();
assert_eq!((style.popup_width, style.popup_height, style.swatch_size), (282.0, 318.0, 18.0));Fields§
§base: PickerBaseStyleShared trigger and popup tokens.
popup_width: f32Popup width in logical pixels.
popup_height: f32Popup height in logical pixels.
swatch_size: f32Palette swatch side length in logical pixels.
Implementations§
Source§impl ColorPickerStyle
impl ColorPickerStyle
Sourcepub fn from_theme(theme: Theme, size: ColorPickerSize) -> Self
pub fn from_theme(theme: Theme, size: ColorPickerSize) -> Self
Derives color-picker style and geometry from theme and density.
Compact uses popup 250 x 284 and 16-pixel swatches; default uses
282 x 318 and 18-pixel swatches.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{ColorPickerSize, ColorPickerStyle};
let style = ColorPickerStyle::from_theme(Theme::default(), ColorPickerSize::Compact);
assert_eq!((style.popup_width, style.popup_height, style.swatch_size), (250.0, 284.0, 16.0));Trait Implementations§
Source§impl Clone for ColorPickerStyle
impl Clone for ColorPickerStyle
Source§fn clone(&self) -> ColorPickerStyle
fn clone(&self) -> ColorPickerStyle
Returns a copy 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 Debug for ColorPickerStyle
impl Debug for ColorPickerStyle
Source§impl Default for ColorPickerStyle
impl Default for ColorPickerStyle
Source§impl PartialEq for ColorPickerStyle
impl PartialEq for ColorPickerStyle
impl StructuralPartialEq for ColorPickerStyle
Auto Trait Implementations§
impl Freeze for ColorPickerStyle
impl RefUnwindSafe for ColorPickerStyle
impl Send for ColorPickerStyle
impl Sync for ColorPickerStyle
impl Unpin for ColorPickerStyle
impl UnwindSafe for ColorPickerStyle
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.