Struct zng_wgt_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() -> Self
pub fn window() -> Self
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() -> Self
pub fn foreground() -> Self
Mode where the widget behaves like a foreground
to the target widget.
sourcepub fn popup(place: AnchorOffset) -> Self
pub fn popup(place: AnchorOffset) -> Self
Mode where widget behaves like a flyout menu for the anchor.
sourcepub fn tooltip_shortcut() -> Self
pub fn tooltip_shortcut() -> Self
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>) -> Self
pub fn with_transform(self, transform: impl Into<AnchorTransform>) -> Self
Returns the mode with transform
set.
sourcepub fn with_min_size(self, size: impl Into<AnchorSize>) -> Self
pub fn with_min_size(self, size: impl Into<AnchorSize>) -> Self
Returns the mode with min_size
set.
sourcepub fn with_max_size(self, size: impl Into<AnchorSize>) -> Self
pub fn with_max_size(self, size: impl Into<AnchorSize>) -> Self
Returns the mode with max_size
set.
sourcepub fn with_size(self, size: impl Into<AnchorSize>) -> Self
pub fn with_size(self, size: impl Into<AnchorSize>) -> Self
Returns the mode with min_size
and max_size
set.
sourcepub fn with_visibility(self, visibility: bool) -> Self
pub fn with_visibility(self, visibility: bool) -> Self
Returns the mode with visibility
set.
sourcepub fn with_interactivity(self, interactivity: bool) -> Self
pub fn with_interactivity(self, interactivity: bool) -> Self
Returns the mode with interactivity
set.
sourcepub fn with_corner_radius(self, corner_radius: bool) -> Self
pub fn with_corner_radius(self, corner_radius: bool) -> Self
Returns the mode with corner_radius
set.
sourcepub fn with_viewport_bound(self, viewport_bound: bool) -> Self
pub fn with_viewport_bound(self, viewport_bound: bool) -> Self
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§impl<'de> Deserialize<'de> for AnchorMode
impl<'de> Deserialize<'de> for AnchorMode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<T: Into<AnchorTransform>, S: Into<AnchorSize>> From<(T, S)> for AnchorMode
impl<T: Into<AnchorTransform>, S: Into<AnchorSize>> From<(T, S)> for AnchorMode
source§impl From<AnchorOffset> for AnchorMode
impl From<AnchorOffset> for AnchorMode
source§fn from(inner_offset: AnchorOffset) -> Self
fn from(inner_offset: AnchorOffset) -> Self
Transform InnerOffset
, all else default.
source§impl From<AnchorTransform> for AnchorMode
impl From<AnchorTransform> for AnchorMode
source§fn from(transform: AnchorTransform) -> Self
fn from(transform: AnchorTransform) -> Self
Custom transform, all else default.
source§impl<T: Into<AnchorTransform>, S: Into<AnchorSize>> IntoVar<AnchorMode> for (T, S)
impl<T: Into<AnchorTransform>, S: Into<AnchorSize>> IntoVar<AnchorMode> for (T, S)
source§impl IntoVar<AnchorMode> for AnchorOffset
impl IntoVar<AnchorMode> for AnchorOffset
source§impl IntoVar<AnchorMode> for AnchorTransform
impl IntoVar<AnchorMode> for AnchorTransform
source§impl PartialEq for AnchorMode
impl PartialEq for AnchorMode
source§impl Serialize for AnchorMode
impl Serialize for AnchorMode
impl<T: Into<AnchorTransform>, S: Into<AnchorSize>> 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§
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> 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> 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