pub enum AccessKeyStyle {
Ampersand,
Underscore,
Plain,
}Expand description
How a shared menu label renders its access-key marker.
The portable convention is the Win32-native spelling: a & before the
mnemonic character, for example "&File" or "New &Folder". &&
escapes a literal ampersand. Backends translate the marker to their
toolkit’s spelling before creating the native menu item:
- Win32 supports the marker as written (
AccessKeyStyle::Ampersand) and Windows underlines the key and opens the menu withAlt. - GTK underlines the character after
_, so the marker is rewritten (AccessKeyStyle::Underscore). - macOS menus carry no mnemonic underlines; the marker is stripped so a
stray
&never reaches the title (AccessKeyStyle::Plain).
A label without a marker passes through every style unchanged.
Variants§
Ampersand
Keep the & marker as written (Win32 menus).
Underscore
Rewrite &X to _X (GTK menus).
Plain
Strip the marker (macOS menus).
Trait Implementations§
Source§impl Clone for AccessKeyStyle
impl Clone for AccessKeyStyle
impl Copy for AccessKeyStyle
Source§impl Debug for AccessKeyStyle
impl Debug for AccessKeyStyle
impl Eq for AccessKeyStyle
Source§impl Hash for AccessKeyStyle
impl Hash for AccessKeyStyle
Source§impl PartialEq for AccessKeyStyle
impl PartialEq for AccessKeyStyle
impl StructuralPartialEq for AccessKeyStyle
Auto Trait Implementations§
impl Forget for AccessKeyStyle
impl Freeze for AccessKeyStyle
impl Move for AccessKeyStyle
impl RefUnwindSafe for AccessKeyStyle
impl Send for AccessKeyStyle
impl Sync for AccessKeyStyle
impl Unpin for AccessKeyStyle
impl UnsafeUnpin for AccessKeyStyle
impl UnwindSafe for AccessKeyStyle
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