pub enum ContextMenuPlacement {
AnchorPoint,
Below,
Above,
}Expand description
Preferred placement of a ContextMenu relative to its anchor.
AnchorPoint is the right-click default: the anchor IS the cursor
position. The menu’s top-left corner aligns with the anchor; the
menu shifts up/left to keep the box inside the viewport but never
flips directionality.
Below and Above enable dropdown-style placement: the anchor is
the trigger element (e.g. a button), and the menu opens above or
below it. The layout auto-flips to the opposite side if the
preferred direction would overflow the viewport — same behaviour as
super::tooltip::TooltipPlacement.
Variants§
AnchorPoint
Right-click default: anchor is the cursor position. No flipping.
Below
Open below the anchor (e.g. dropdown attached to a top-row button). Auto-flips to above if it would overflow the bottom.
Above
Open above the anchor (e.g. dropdown attached to a bottom-row button — kubeui’s namespace picker). Auto-flips to below if it would overflow the top.
Trait Implementations§
Source§impl Clone for ContextMenuPlacement
impl Clone for ContextMenuPlacement
impl Copy for ContextMenuPlacement
Source§impl Debug for ContextMenuPlacement
impl Debug for ContextMenuPlacement
Source§impl Default for ContextMenuPlacement
impl Default for ContextMenuPlacement
Source§impl<'de> Deserialize<'de> for ContextMenuPlacement
impl<'de> Deserialize<'de> for ContextMenuPlacement
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>,
impl Eq for ContextMenuPlacement
Source§impl PartialEq for ContextMenuPlacement
impl PartialEq for ContextMenuPlacement
Source§impl Serialize for ContextMenuPlacement
impl Serialize for ContextMenuPlacement
impl StructuralPartialEq for ContextMenuPlacement
Auto Trait Implementations§
impl Freeze for ContextMenuPlacement
impl RefUnwindSafe for ContextMenuPlacement
impl Send for ContextMenuPlacement
impl Sync for ContextMenuPlacement
impl Unpin for ContextMenuPlacement
impl UnsafeUnpin for ContextMenuPlacement
impl UnwindSafe for ContextMenuPlacement
Blanket Implementations§
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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