pub struct Popup;Expand description
With the latest enhancement of Focus this is obsolete.
Focus collects all the areas of widgets and containers and can set a z-index
for each area. With this information it runs a hit-test for each mouse event
and sets and sets the mouse-focus flag for each widget and container.
This works well with popups and overlapping widgets. This makes the
differentiation between regular widgets and widgets that might show a popup
that overlaps other widgets obsolete.
If you don’t use Focus you will still have to consider the information below.
Obsoleted
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 might show a popup, you have to call its event-handling
before any other widgets that might be (partially) hidden behind the
widget. This applies for e.g. Menubar, Choice and ComboBox.
To make this difference visible in the application code, these widgets
use Popup as marker for their event-handling instead of Regular.
If you implement a widget with a popup, you must make sure to consume all mouse-events within the widget area to prevent any interaction with a hidden widget.
Trait Implementations§
Source§impl<T: PartialEq + Clone + Default> HandleEvent<Event, Popup, ChoiceOutcome> for ChoiceState<T>
impl<T: PartialEq + Clone + Default> HandleEvent<Event, Popup, ChoiceOutcome> for ChoiceState<T>
Source§impl HandleEvent<Event, Popup, ComboboxOutcome> for ComboboxState
impl HandleEvent<Event, Popup, ComboboxOutcome> for ComboboxState
Source§impl HandleEvent<Event, Popup, MenuOutcome> for MenubarState
impl HandleEvent<Event, Popup, MenuOutcome> for MenubarState
Source§impl HandleEvent<Event, Popup, MenuOutcome> for PopupMenuState
impl HandleEvent<Event, Popup, MenuOutcome> for PopupMenuState
Source§impl HandleEvent<Event, Popup, PopupOutcome> for PopupCoreState
impl HandleEvent<Event, Popup, PopupOutcome> for PopupCoreState
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 UnsafeUnpin 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
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>
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