pub struct Popup;Expand description
Popup/Overlays are a bit difficult to handle, as there is no z-order/area tree, which would direct mouse interactions. We can simulate a z-order in the event-handler by trying the things with a higher z-order first.
If a widget should be seen as pure overlay, it would define only a Popup event-handler. In the event-handling functions you would call all Popup event-handlers before the regular ones.
Example:
- Context menu. If the context-menu is active, it can consume all mouse-events that fall into its range, and the widgets behind it only get the rest.
- Menubar. Would define two event-handlers, a regular one for all events on the main menu bar, and a popup event-handler for the menus. The event-handling function calls the popup handler first and the regular one at some time later.
Trait Implementations§
impl Copy for Popup
Auto Trait Implementations§
impl Freeze for Popup
impl RefUnwindSafe for Popup
impl Send for Popup
impl Sync for Popup
impl Unpin for Popup
impl UnwindSafe for Popup
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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