pub struct NoopNativeMenuBackend;Expand description
Backend that renders nothing. Used on platforms without a native-menu
implementation (everything except macOS today) so cross-platform code that
installs a native menu compiles and runs — the in-window MenuBar remains
the menu surface there.
Implementations§
Trait Implementations§
Source§impl Default for NoopNativeMenuBackend
impl Default for NoopNativeMenuBackend
Source§impl NativeMenuBackend for NoopNativeMenuBackend
impl NativeMenuBackend for NoopNativeMenuBackend
Build (or replace) the native menu of
window_id, a window with a
menu of its own, from menu. For every item the user later chooses,
the backend MUST post a NativeMenuEventPayload, with
window_id_owner == window_id, through poster. If window_id is
the key window (the last one activate_window
named), or no window has been activated yet, the backend shows this
menu.Source§fn activate_window(&mut self, _window_id: TeksiloWindowId)
fn activate_window(&mut self, _window_id: TeksiloWindowId)
window_id became the key window (focus follows window): show the
bar [key_window_bar] picks, its own menu if it set one, else the
menu of the window it belongs to (see
set_window_owner), else the
application menu, or, when the application
declared none, the bar shown before.Source§fn clear_window(&mut self, _window_id: TeksiloWindowId)
fn clear_window(&mut self, _window_id: TeksiloWindowId)
Forget
window_id’s menu (the window closed, or no longer has a menu
of its own). If it was showing, show the
application menu until another window becomes
key.Source§fn update_item(&mut self, _id: MenuItemId, _delta: MenuItemDelta)
fn update_item(&mut self, _id: MenuItemId, _delta: MenuItemDelta)
Apply a reactive delta to a single already-installed item, in every
menu that carries it, the application menu included.
Set the application menu: the menu shown whenever the key window has
no menu of its own nor an owner with one, and while no window is
open.
teksilo-app sets it from the application tree at startup and
again whenever it changes; it replaces any earlier one, and the bar
is chosen again for the key window, as
activate_window chooses it: an
application menu declared while a window
with no menu of its own is key shows at once. declared
says whether the application declared it: false for the default
App menu teksilo-app supplies when it declared none, which a key
window without a menu does not bring up (see [key_window_bar]).
For every item the user later chooses in it, the backend MUST post a
NativeAppMenuEventPayload through poster. The default does
nothing, for a backend whose menus belong to windows alone.Auto Trait Implementations§
impl Freeze for NoopNativeMenuBackend
impl RefUnwindSafe for NoopNativeMenuBackend
impl Send for NoopNativeMenuBackend
impl Sync for NoopNativeMenuBackend
impl Unpin for NoopNativeMenuBackend
impl UnsafeUnpin for NoopNativeMenuBackend
impl UnwindSafe for NoopNativeMenuBackend
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.