#[non_exhaustive]pub enum TransformHandle {
Move,
TopLeading,
Top,
TopTrailing,
Leading,
Trailing,
BottomLeading,
Bottom,
BottomTrailing,
Rotate,
}Expand description
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Move
The frame band — drag it to move the whole selection.
TopLeading
Top-leading corner.
Top
Top edge midpoint.
TopTrailing
Top-trailing corner.
Leading
Leading edge midpoint.
Trailing
Trailing edge midpoint.
BottomLeading
Bottom-leading corner.
Bottom
Bottom edge midpoint.
BottomTrailing
Bottom-trailing corner.
Rotate
The rotate puck, above the top edge.
Implementations§
Source§impl TransformHandle
impl TransformHandle
Sourcepub const fn op(self) -> TransformOp
pub const fn op(self) -> TransformOp
Which operation dragging this handle performs.
Sourcepub const fn cursor(self) -> CursorIcon
pub const fn cursor(self) -> CursorIcon
The pointer cursor for this handle, in an unrotated frame. A rotated frame keeps these — the four diagonal / axis cursors do not have enough resolution to track an arbitrary angle, and guessing wrong is worse than a cursor that is merely approximate.
Sourcepub const fn is_scalar(self) -> bool
pub const fn is_scalar(self) -> bool
Whether this handle’s state is one number or two.
An edge midpoint carries the coordinate of the edge it drags; the rotate
puck carries an angle. Both are one number, so both are a Slider with
a numeric_value, and Increment / Decrement mean exactly “make that
number bigger / smaller”.
A corner carries two coordinates and the frame band carries the whole
selection’s position, so neither has a single value to announce. They
are Buttons, and their one-dimensional verbs move both coordinates
— see at_steps.
Three things read this and must agree: the published role, whether a
numeric_value is set, and what one assistive-technology verb does.
Sourcepub const fn at_steps(self, increment: bool) -> &'static [TransformStep]
pub const fn at_steps(self, increment: bool) -> &'static [TransformStep]
The steps one assistive-technology Increment (or Decrement) is made
of, as directions the keyboard route already understands.
One rule covers every handle: a step moves each coordinate the handle
drives by +1 (Increment) or -1 (Decrement), and leaves the rest
alone.
For a scalar handle that is the coordinate its
numeric_value announces, which is what makes the slider contract true:
Increment on “Resize bottom” raises the bottom edge’s y, and the
announced number goes up by one. Before this existed every verb was a
horizontal nudge, so Top and Bottom reported “handled” and moved
nothing at all — the item’s height could not be changed by any
assistive-technology route.
For a corner the same rule gives the diagonal: Increment on “Resize
top leading” moves that corner’s x and y up by one, which is
exactly Increment on “Resize top” plus Increment on “Resize
leading” — the two edges the corner sits between, together. That is the
only motion a corner can express with a one-dimensional verb, and it
keeps the corner reachable when a configuration offers corners and
nothing else. A user who needs one axis at a time reaches it through the
four named custom actions a non-scalar handle also publishes (see
TransformStep); the frame band works the same way.
Trait Implementations§
Source§impl Clone for TransformHandle
impl Clone for TransformHandle
Source§fn clone(&self) -> TransformHandle
fn clone(&self) -> TransformHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TransformHandle
Source§impl Debug for TransformHandle
impl Debug for TransformHandle
impl Eq for TransformHandle
Source§impl Hash for TransformHandle
impl Hash for TransformHandle
Source§impl Ord for TransformHandle
impl Ord for TransformHandle
Source§fn cmp(&self, other: &TransformHandle) -> Ordering
fn cmp(&self, other: &TransformHandle) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TransformHandle
impl PartialEq for TransformHandle
Source§impl PartialOrd for TransformHandle
impl PartialOrd for TransformHandle
impl StructuralPartialEq for TransformHandle
Auto Trait Implementations§
impl Freeze for TransformHandle
impl RefUnwindSafe for TransformHandle
impl Send for TransformHandle
impl Sync for TransformHandle
impl Unpin for TransformHandle
impl UnsafeUnpin for TransformHandle
impl UnwindSafe for TransformHandle
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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