Struct zng::layer::AnchorMode
source · pub struct AnchorMode {
pub transform: AnchorTransform,
pub min_size: AnchorSize,
pub max_size: AnchorSize,
pub viewport_bound: bool,
pub visibility: bool,
pub interactivity: bool,
pub corner_radius: bool,
}
Expand description
Defines what properties the layered widget takes from the anchor widget.
Fields§
§transform: AnchorTransform
What transforms are copied from the anchor widget and applied as a parent transform of the widget.
min_size: AnchorSize
What size is copied from the anchor widget and used as the available and final min size of the widget.
max_size: AnchorSize
What size is copied from the anchor widget and used as the available and final max size of the widget.
viewport_bound: bool
After the transform
and size
are resolved the transform is adjusted so that the layered widget is
fully visible in the window.
Has no effect if AnchorTransform::None
.
visibility: bool
If the widget is only layout if the anchor widget is not Collapsed
and is only rendered
if the anchor widget is rendered.
interactivity: bool
The widget interactivity
is set to the same as the anchor widget.
corner_radius: bool
The widget’s corner radius is set for the layer.
If size
is InnerBorder
the corner radius are deflated to fit the inner curve of the borders.
Implementations§
source§impl AnchorMode
impl AnchorMode
sourcepub fn window() -> AnchorMode
pub fn window() -> AnchorMode
Mode where widget behaves like an unanchored widget, except that it is still only layout an rendered if the anchor widget exists in the same window.
sourcepub fn foreground() -> AnchorMode
pub fn foreground() -> AnchorMode
Mode where the widget behaves like a foreground
to the target widget.
sourcepub fn popup(place: AnchorOffset) -> AnchorMode
pub fn popup(place: AnchorOffset) -> AnchorMode
Mode where widget behaves like a flyout menu for the anchor.
sourcepub fn tooltip() -> AnchorMode
pub fn tooltip() -> AnchorMode
Mode where the widget behaves like a tooltip anchored to the cursor.
sourcepub fn tooltip_shortcut() -> AnchorMode
pub fn tooltip_shortcut() -> AnchorMode
Mode where the widget behaves like a tooltip anchored to the widget.
Mode where the widget behaves like a context-menu anchored to the cursor.
Mode where the widget behaves like a context-menu anchored to widget.
sourcepub fn with_transform(self, transform: impl Into<AnchorTransform>) -> AnchorMode
pub fn with_transform(self, transform: impl Into<AnchorTransform>) -> AnchorMode
Returns the mode with transform
set.
sourcepub fn with_min_size(self, size: impl Into<AnchorSize>) -> AnchorMode
pub fn with_min_size(self, size: impl Into<AnchorSize>) -> AnchorMode
Returns the mode with min_size
set.
sourcepub fn with_max_size(self, size: impl Into<AnchorSize>) -> AnchorMode
pub fn with_max_size(self, size: impl Into<AnchorSize>) -> AnchorMode
Returns the mode with max_size
set.
sourcepub fn with_size(self, size: impl Into<AnchorSize>) -> AnchorMode
pub fn with_size(self, size: impl Into<AnchorSize>) -> AnchorMode
Returns the mode with min_size
and max_size
set.
sourcepub fn with_visibility(self, visibility: bool) -> AnchorMode
pub fn with_visibility(self, visibility: bool) -> AnchorMode
Returns the mode with visibility
set.
sourcepub fn with_interactivity(self, interactivity: bool) -> AnchorMode
pub fn with_interactivity(self, interactivity: bool) -> AnchorMode
Returns the mode with interactivity
set.
sourcepub fn with_corner_radius(self, corner_radius: bool) -> AnchorMode
pub fn with_corner_radius(self, corner_radius: bool) -> AnchorMode
Returns the mode with corner_radius
set.
sourcepub fn with_viewport_bound(self, viewport_bound: bool) -> AnchorMode
pub fn with_viewport_bound(self, viewport_bound: bool) -> AnchorMode
Returns the mode with viewport_bound
set.
Trait Implementations§
source§impl Clone for AnchorMode
impl Clone for AnchorMode
source§fn clone(&self) -> AnchorMode
fn clone(&self) -> AnchorMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AnchorMode
impl Debug for AnchorMode
source§impl Default for AnchorMode
impl Default for AnchorMode
source§fn default() -> AnchorMode
fn default() -> AnchorMode
Transform InnerOffset
top-left, size infinite, copy visibility and corner-radius.
source§impl<'de> Deserialize<'de> for AnchorMode
impl<'de> Deserialize<'de> for AnchorMode
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AnchorMode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AnchorMode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl<T, S> From<(T, S)> for AnchorMode
impl<T, S> From<(T, S)> for AnchorMode
source§fn from(_: (T, S)) -> AnchorMode
fn from(_: (T, S)) -> AnchorMode
Custom transform and size, all else default.
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<AnchorTransform> for AnchorMode
impl From<AnchorTransform> for AnchorMode
source§fn from(transform: AnchorTransform) -> AnchorMode
fn from(transform: AnchorTransform) -> AnchorMode
Custom transform, all else default.
source§impl<T, S> IntoVar<AnchorMode> for (T, S)
impl<T, S> IntoVar<AnchorMode> for (T, S)
source§fn into_var(self) -> <(T, S) as IntoVar<AnchorMode>>::Var
fn into_var(self) -> <(T, S) as IntoVar<AnchorMode>>::Var
Custom transform and size, 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 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 IntoVar<AnchorMode> for AnchorTransform
impl IntoVar<AnchorMode> for AnchorTransform
source§fn into_var(self) -> <AnchorTransform as IntoVar<AnchorMode>>::Var
fn into_var(self) -> <AnchorTransform as IntoVar<AnchorMode>>::Var
Custom transform, 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 PartialEq for AnchorMode
impl PartialEq for AnchorMode
source§impl Serialize for AnchorMode
impl Serialize for AnchorMode
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,
impl<T, S> IntoValue<AnchorMode> for (T, S)
impl IntoValue<AnchorMode> for AnchorOffset
impl IntoValue<AnchorMode> for AnchorTransform
impl StructuralPartialEq for AnchorMode
Auto Trait Implementations§
impl Freeze for AnchorMode
impl RefUnwindSafe for AnchorMode
impl Send for AnchorMode
impl Sync for AnchorMode
impl Unpin for AnchorMode
impl UnwindSafe for AnchorMode
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.