pub struct EyedropperArea { /* private fields */ }Expand description
Where an eyedropper picks from, over a picture. While armed, a click asks sampler for the
color at that point of the content, in the units of the space; a point out of
the content or a None picks nothing and leaves it armed. While not armed it takes no input.
CursorIcon has no eyedropper, so while armed the cursor is the pointing hand.
Implementations§
Source§impl EyedropperArea
impl EyedropperArea
Sourcepub fn new(
state: &EyedropperState,
sampler: impl Fn(Point) -> Option<Color> + 'static,
) -> EyedropperArea
pub fn new( state: &EyedropperState, sampler: impl Fn(Point) -> Option<Color> + 'static, ) -> EyedropperArea
An area of this eyedropper that reads colors with sampler.
Source§impl EyedropperArea
impl EyedropperArea
Sourcepub fn size(self, width: f32, height: f32) -> EyedropperArea
pub fn size(self, width: f32, height: f32) -> EyedropperArea
Fixed size in logical pixels, instead of taking the free space.
Sourcepub fn grow(self, grow: f32) -> EyedropperArea
pub fn grow(self, grow: f32) -> EyedropperArea
How much of the free space along the parent stack it takes: 1 by default, or 0 over a stage, which then decides the size.
Sourcepub fn stage(self, stage: impl View + 'static) -> EyedropperArea
pub fn stage(self, stage: impl View + 'static) -> EyedropperArea
The view it goes over, such as an Image or a
ZoomPanView, which gives it its size. Without one, put it in
a ZStack with a fixed size.
Sourcepub fn space(self, space: ContentSpace) -> EyedropperArea
pub fn space(self, space: ContentSpace) -> EyedropperArea
Where the content is, and so the units of its coordinates: by default, its own box.
Trait Implementations§
Source§impl Debug for EyedropperArea
impl Debug for EyedropperArea
Auto Trait Implementations§
impl !RefUnwindSafe for EyedropperArea
impl !Send for EyedropperArea
impl !Sync for EyedropperArea
impl !UnwindSafe for EyedropperArea
impl Freeze for EyedropperArea
impl Unpin for EyedropperArea
impl UnsafeUnpin for EyedropperArea
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
None keeps the content size.