Misc code cleanups accumulated while working on other changes (#34787)
Release Notes: - N/A
This commit is contained in:
parent
7c1040bc93
commit
137081f050
7 changed files with 9 additions and 21 deletions
|
@ -34,7 +34,7 @@ fn main() {
|
|||
});
|
||||
}
|
||||
|
||||
// Associate actions using the `actions!` macro (or `impl_actions!` macro)
|
||||
// Associate actions using the `actions!` macro (or `Action` derive macro)
|
||||
actions!(set_menus, [Quit]);
|
||||
|
||||
// Define the quit function that is registered with the App
|
||||
|
|
|
@ -1370,7 +1370,9 @@ impl App {
|
|||
self.keymap.clone()
|
||||
}
|
||||
|
||||
/// Register a global listener for actions invoked via the keyboard.
|
||||
/// Register a global handler for actions invoked via the keyboard. These handlers are run at
|
||||
/// the end of the bubble phase for actions, and so will only be invoked if there are no other
|
||||
/// handlers or if they called `cx.propagate()`.
|
||||
pub fn on_action<A: Action>(&mut self, listener: impl Fn(&A, &mut Self) + 'static) {
|
||||
self.global_action_listeners
|
||||
.entry(TypeId::of::<A>())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue