pub struct AnchorOffset {
pub place: Point,
pub origin: Point,
}
Expand description
Represents two points that position a layer widget with its anchor widget.
The place
point is layout in the anchor widget bounds, the origin
point is layout in the layer widget bounds,
the layer widget is offset so that the origin
point aligns with the place
point.
Fields§
§place: Point
Point in the anchor widget.
origin: Point
Point in the layer widget.
Implementations§
source§impl AnchorOffset
impl AnchorOffset
sourcepub fn new(point: Point) -> AnchorOffset
pub fn new(point: Point) -> AnchorOffset
New place and origin points from same point
.
sourcepub fn in_top() -> AnchorOffset
pub fn in_top() -> AnchorOffset
Layer widget is horizontally centered on the anchor widget and the top edge aligns.
sourcepub fn in_bottom() -> AnchorOffset
pub fn in_bottom() -> AnchorOffset
Layer widget is horizontally centered on the anchor widget and the bottom edge aligns.
sourcepub fn in_left() -> AnchorOffset
pub fn in_left() -> AnchorOffset
Layer widget is vertically centered on the anchor widget and the left edge aligns.
sourcepub fn in_right() -> AnchorOffset
pub fn in_right() -> AnchorOffset
Layer widget is vertically centered on the anchor widget and the right edge aligns.
sourcepub fn in_top_left() -> AnchorOffset
pub fn in_top_left() -> AnchorOffset
Layer widget top-left corner aligns with the anchor widget top-left corner.
sourcepub fn in_top_right() -> AnchorOffset
pub fn in_top_right() -> AnchorOffset
Layer widget top-right corner aligns with the anchor widget top-right corner.
sourcepub fn in_bottom_left() -> AnchorOffset
pub fn in_bottom_left() -> AnchorOffset
Layer widget bottom-left corner aligns with the anchor widget bottom-left corner.
sourcepub fn in_bottom_right() -> AnchorOffset
pub fn in_bottom_right() -> AnchorOffset
Layer widget bottom-right corner aligns with the anchor widget bottom-right corner.
sourcepub fn center() -> AnchorOffset
pub fn center() -> AnchorOffset
Layer widget is centered on the anchor widget.
sourcepub fn out_top() -> AnchorOffset
pub fn out_top() -> AnchorOffset
Layer widget is horizontally centered on the anchor widget and its bottom edge aligns with the anchors top edge.
sourcepub fn out_bottom() -> AnchorOffset
pub fn out_bottom() -> AnchorOffset
Layer widget is horizontally centered on the anchor widget and its top edge aligns with the anchors bottom edge.
sourcepub fn out_left() -> AnchorOffset
pub fn out_left() -> AnchorOffset
Layer widget is vertically centered on the anchor widget and its right edge aligns with the anchors left edge.
sourcepub fn out_right() -> AnchorOffset
pub fn out_right() -> AnchorOffset
Layer widget is vertically centered on the anchor widget and its left edge aligns with the anchors right edge.
sourcepub fn out_top_left() -> AnchorOffset
pub fn out_top_left() -> AnchorOffset
Layer widget bottom-right corner aligns with anchor widget top-left corner.
sourcepub fn out_top_right() -> AnchorOffset
pub fn out_top_right() -> AnchorOffset
Layer widget bottom-left corner aligns with anchor widget top-right corner.
sourcepub fn out_bottom_left() -> AnchorOffset
pub fn out_bottom_left() -> AnchorOffset
Layer widget top-right corner aligns with anchor widget bottom-left corner.
sourcepub fn out_bottom_right() -> AnchorOffset
pub fn out_bottom_right() -> AnchorOffset
Layer widget bottom-right corner aligns with anchor widget top-left corner.
sourcepub fn out_top_in_left() -> AnchorOffset
pub fn out_top_in_left() -> AnchorOffset
Layer widget bottom-left corner aligns with anchor widget top-left corner.
sourcepub fn out_top_in_right() -> AnchorOffset
pub fn out_top_in_right() -> AnchorOffset
Layer widget bottom-right corner aligns with anchor widget top-right corner.
sourcepub fn out_bottom_in_left() -> AnchorOffset
pub fn out_bottom_in_left() -> AnchorOffset
Layer widget top-left corner aligns with anchor widget bottom-left corner.
sourcepub fn out_bottom_in_right() -> AnchorOffset
pub fn out_bottom_in_right() -> AnchorOffset
Layer widget top-right corner aligns with anchor widget bottom-right corner.
sourcepub fn out_left_in_top() -> AnchorOffset
pub fn out_left_in_top() -> AnchorOffset
Layer widget top-right corner aligns with anchor widget top-left corner.
sourcepub fn out_left_in_bottom() -> AnchorOffset
pub fn out_left_in_bottom() -> AnchorOffset
Layer widget bottom-right corner aligns with anchor widget bottom-left corner.
sourcepub fn out_right_in_top() -> AnchorOffset
pub fn out_right_in_top() -> AnchorOffset
Layer widget top-left corner aligns with anchor widget top-right corner.
sourcepub fn out_right_in_bottom() -> AnchorOffset
pub fn out_right_in_bottom() -> AnchorOffset
Layer widget bottom-left corner aligns with anchor widget bottom-right corner.
Trait Implementations§
source§impl Clone for AnchorOffset
impl Clone for AnchorOffset
source§fn clone(&self) -> AnchorOffset
fn clone(&self) -> AnchorOffset
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AnchorOffset
impl Debug for AnchorOffset
source§impl<'de> Deserialize<'de> for AnchorOffset
impl<'de> Deserialize<'de> for AnchorOffset
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AnchorOffset, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AnchorOffset, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl<P, O> From<(P, O)> for AnchorOffset
impl<P, O> From<(P, O)> for AnchorOffset
source§fn from(place_origin: (P, O)) -> AnchorOffset
fn from(place_origin: (P, O)) -> AnchorOffset
(place, origin)
.
source§impl From<AnchorOffset> for AnchorMode
impl From<AnchorOffset> for AnchorMode
source§fn from(inner_offset: AnchorOffset) -> AnchorMode
fn from(inner_offset: AnchorOffset) -> AnchorMode
Transform InnerOffset
, all else default.
source§impl From<AnchorOffset> for AnchorTransform
impl From<AnchorOffset> for AnchorTransform
source§fn from(inner_offset: AnchorOffset) -> AnchorTransform
fn from(inner_offset: AnchorOffset) -> AnchorTransform
InnerOffset
.
source§impl IntoVar<AnchorMode> for AnchorOffset
impl IntoVar<AnchorMode> for AnchorOffset
source§fn into_var(self) -> <AnchorOffset as IntoVar<AnchorMode>>::Var
fn into_var(self) -> <AnchorOffset as IntoVar<AnchorMode>>::Var
Transform InnerOffset
, all else default.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl<P, O> IntoVar<AnchorOffset> for (P, O)
impl<P, O> IntoVar<AnchorOffset> for (P, O)
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<AnchorTransform> for AnchorOffset
impl IntoVar<AnchorTransform> for AnchorOffset
source§fn into_var(self) -> <AnchorOffset as IntoVar<AnchorTransform>>::Var
fn into_var(self) -> <AnchorOffset as IntoVar<AnchorTransform>>::Var
InnerOffset
.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl PartialEq for AnchorOffset
impl PartialEq for AnchorOffset
source§impl Serialize for AnchorOffset
impl Serialize for AnchorOffset
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
source§impl Transitionable for AnchorOffset
impl Transitionable for AnchorOffset
source§fn lerp(self, to: &AnchorOffset, step: Factor) -> AnchorOffset
fn lerp(self, to: &AnchorOffset, step: Factor) -> AnchorOffset
self
-> to
by step
.impl IntoValue<AnchorMode> for AnchorOffset
impl<P, O> IntoValue<AnchorOffset> for (P, O)
impl IntoValue<AnchorTransform> for AnchorOffset
impl StructuralPartialEq for AnchorOffset
Auto Trait Implementations§
impl Freeze for AnchorOffset
impl RefUnwindSafe for AnchorOffset
impl Send for AnchorOffset
impl Sync for AnchorOffset
impl Unpin for AnchorOffset
impl UnwindSafe for AnchorOffset
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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
source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§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>
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>
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