pub struct MenubarState {
pub area: Rect,
pub bar: MenuLineState,
pub popup: PopupMenuState,
pub non_exhaustive: NonExhaustive,
/* private fields */
}Expand description
State & event-handling.
Fields§
§area: RectArea for the main-menubar. readonly. renewed for each render.
bar: MenuLineStateState for the menu.
popup: PopupMenuStateState for the last rendered popup menu.
non_exhaustive: NonExhaustiveImplementations§
Source§impl MenubarState
impl MenubarState
Sourcepub fn new() -> MenubarState
pub fn new() -> MenubarState
State.
For the specifics use the public fields menu and popup.
Sourcepub fn named(name: &'static str) -> MenubarState
pub fn named(name: &'static str) -> MenubarState
New state with a focus name.
Sourcepub fn popup_active(&self) -> bool
pub fn popup_active(&self) -> bool
Submenu visible/active.
Sourcepub fn set_popup_active(&mut self, active: bool)
pub fn set_popup_active(&mut self, active: bool)
Submenu visible/active.
Sourcepub fn set_popup_z(&mut self, z: u16)
pub fn set_popup_z(&mut self, z: u16)
Set the z-value for the popup-menu.
This is the z-index used when adding the menubar to the focus list.
Trait Implementations§
Source§impl Clone for MenubarState
impl Clone for MenubarState
Source§fn clone(&self) -> MenubarState
fn clone(&self) -> MenubarState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MenubarState
impl Debug for MenubarState
Source§impl Default for MenubarState
impl Default for MenubarState
Source§fn default() -> MenubarState
fn default() -> MenubarState
Returns the “default value” for a type. Read more
Source§impl HandleEvent<Event, MouseOnly, MenuOutcome> for MenubarState
impl HandleEvent<Event, MouseOnly, MenuOutcome> for MenubarState
Source§impl HandleEvent<Event, Popup, MenuOutcome> for MenubarState
impl HandleEvent<Event, Popup, MenuOutcome> for MenubarState
Source§impl HandleEvent<Event, Regular, MenuOutcome> for MenubarState
impl HandleEvent<Event, Regular, MenuOutcome> for MenubarState
Source§impl HasFocus for MenubarState
impl HasFocus for MenubarState
Source§fn build(&self, builder: &mut FocusBuilder)
fn build(&self, builder: &mut FocusBuilder)
Build the focus-structure for the container/widget.
Build the focus-structure for the container/widget. Read more
Declares how the widget interacts with focus. Read more
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Does this widget have the focus.
Or, if the flag is used for a container, does any of
widget inside the container have the focus. Read more
Source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
This widget just lost the focus. This flag is set by [Focus::handle]
if there is a focus transfer, and will be reset by the next
call to [Focus::handle]. Read more
Source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
This widget just gained the focus. This flag is set by [Focus::handle]
if there is a focus transfer, and will be reset by the next
call to [Focus::handle]. Read more
Source§fn has_mouse_focus(&self) -> bool
fn has_mouse_focus(&self) -> bool
This flag is set by [Focus::handle], if a mouse-event
matches one of the areas associated with a widget. Read more
Source§impl HasScreenCursor for MenubarState
impl HasScreenCursor for MenubarState
Source§impl RelocatableState for MenubarState
impl RelocatableState for MenubarState
Source§fn relocate(&mut self, shift: (i16, i16), clip: Rect)
fn relocate(&mut self, shift: (i16, i16), clip: Rect)
Relocate the areas in this widgets state. Read more
Source§fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect)
fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect)
Relocate only popup areas.
As rendering the popups is a separate render,
this has to be separate too.
Relocate all popup areas to a clip-rect (0,0+0x0).
Relocate all areas to a clip-rect (0,0+0x0).
Auto Trait Implementations§
impl !Freeze for MenubarState
impl !RefUnwindSafe for MenubarState
impl !Send for MenubarState
impl !Sync for MenubarState
impl Unpin for MenubarState
impl UnsafeUnpin for MenubarState
impl !UnwindSafe for MenubarState
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