pub struct MenuConfig {
pub close_behavior: PopupCloseBehavior,
pub style: StyleModifier,
pub submenu_gap: f32,
/* private fields */
}Available on crate feature
egui only.Expand description
Configuration and style for menus.
Fields§
§close_behavior: PopupCloseBehaviorIf the user clicks, should we close the menu?
style: StyleModifierOverride the menu style.
Default is menu_style.
The visual gap between the frame of a menu and the frames of the submenus it opens.
0.0 places submenus flush against their parent menu.
Default is 2.0.
Implementations§
Source§impl MenuConfig
impl MenuConfig
Sourcepub const MENU_CONFIG_TAG: &'static str = "egui_menu_config"
pub const MENU_CONFIG_TAG: &'static str = "egui_menu_config"
The tag used to store the menu config in the UiStack.
pub fn new() -> MenuConfig
Sourcepub fn close_behavior(self, close_behavior: PopupCloseBehavior) -> MenuConfig
pub fn close_behavior(self, close_behavior: PopupCloseBehavior) -> MenuConfig
If the user clicks, should we close the menu?
Sourcepub fn style(self, style: impl Into<StyleModifier>) -> MenuConfig
pub fn style(self, style: impl Into<StyleModifier>) -> MenuConfig
Override the menu style.
Default is menu_style.
The visual gap between the frame of a menu and the frames of the submenus it opens.
0.0 places submenus flush against their parent menu.
Default is 2.0.
Sourcepub fn find(ui: &Ui) -> MenuConfig
pub fn find(ui: &Ui) -> MenuConfig
Find the config for the current menu.
Returns the default config if no config is found.
Trait Implementations§
Source§impl Clone for MenuConfig
impl Clone for MenuConfig
Source§fn clone(&self) -> MenuConfig
fn clone(&self) -> MenuConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MenuConfig
impl Debug for MenuConfig
Source§impl Default for MenuConfig
impl Default for MenuConfig
Source§fn default() -> MenuConfig
fn default() -> MenuConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for MenuConfig
impl !UnwindSafe for MenuConfig
impl Forget for MenuConfig
impl Freeze for MenuConfig
impl Move for MenuConfig
impl Send for MenuConfig
impl Sync for MenuConfig
impl Unpin for MenuConfig
impl UnsafeUnpin for MenuConfigwhere
*const ArcInner<dyn Fn(&mut Style) + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&mut Style) + Sync + Send>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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