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: AnchorTransformWhat transforms are copied from the anchor widget and applied as a parent transform of the widget.
min_size: AnchorSizeWhat size is copied from the anchor widget and used as the available and final min size of the widget.
max_size: AnchorSizeWhat size is copied from the anchor widget and used as the available and final max size of the widget.
viewport_bound: boolAfter 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: boolIf the widget is only layout if the anchor widget is not Collapsed and is only rendered
if the anchor widget is rendered.
interactivity: boolThe widget interactivity is set to the same as the anchor widget.
corner_radius: boolThe 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§fn into_var(self) -> Var<AnchorMode>
fn into_var(self) -> Var<AnchorMode>
Custom transform and size, all else default.
Source§impl IntoVar<AnchorMode> for AnchorOffset
impl IntoVar<AnchorMode> for AnchorOffset
Source§fn into_var(self) -> Var<AnchorMode>
fn into_var(self) -> Var<AnchorMode>
Transform InnerOffset, all else default.
Source§impl IntoVar<AnchorMode> for AnchorTransform
impl IntoVar<AnchorMode> for AnchorTransform
Source§fn into_var(self) -> Var<AnchorMode>
fn into_var(self) -> Var<AnchorMode>
Custom transform, all else default.
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 T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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,
§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