Misc code cleanups accumulated while working on other changes (#34787)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-07-20 17:22:13 -06:00 committed by GitHub
parent 7c1040bc93
commit 137081f050
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 9 additions and 21 deletions

View file

@ -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

View file

@ -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>())