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() -> 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) -> 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
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 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> 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> 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().