pub struct NativeMenuBar {
pub menus: Vec<NativeMenu>,
}Expand description
原生应用菜单栏。
Windows/macOS 由桌面宿主安装为系统菜单;Linux 当前没有统一原生菜单栏, 宿主会记录警告并忽略(应用可继续使用框架内 Menu 组件)。
Fields§
Implementations§
Source§impl NativeMenuBar
impl NativeMenuBar
pub fn new() -> NativeMenuBar
Sourcepub fn command_ids(&self) -> Vec<u64>
pub fn command_ids(&self) -> Vec<u64>
收集所有命令 id(含嵌套子菜单)。
Sourcepub fn accelerators(&self) -> Vec<(u64, Shortcut)>
pub fn accelerators(&self) -> Vec<(u64, Shortcut)>
收集所有命令的加速键(含嵌套子菜单),供宿主在不转发菜单加速键时使用。
Trait Implementations§
Source§impl Clone for NativeMenuBar
impl Clone for NativeMenuBar
Source§fn clone(&self) -> NativeMenuBar
fn clone(&self) -> NativeMenuBar
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 NativeMenuBar
impl Debug for NativeMenuBar
Source§impl Default for NativeMenuBar
impl Default for NativeMenuBar
Source§fn default() -> NativeMenuBar
fn default() -> NativeMenuBar
Returns the “default value” for a type. Read more
impl Eq for NativeMenuBar
Source§impl PartialEq for NativeMenuBar
impl PartialEq for NativeMenuBar
impl StructuralPartialEq for NativeMenuBar
Auto Trait Implementations§
impl Freeze for NativeMenuBar
impl RefUnwindSafe for NativeMenuBar
impl Send for NativeMenuBar
impl Sync for NativeMenuBar
impl Unpin for NativeMenuBar
impl UnsafeUnpin for NativeMenuBar
impl UnwindSafe for NativeMenuBar
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<T> Brush for T
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.