In napari we would like to make keybindings configurable via settings.
However, the application has only one register of shortcuts.
Also the QModelMenu logic depends on self._app.keybindings (in QCommandAction) to build menu.
My proposition is to add a Application.default_keybindings property to get public access to the default registered keybindings. Then allow the user in the subclass to overwrite the keybindings property with a custom provider.
Then update QMenuItemAction.create to trigger refreshment of keybinding on rebuild of the menus or other action refreshment. (also add proper method to QCommandAction to be called).
What did you think about that?
I'm open to implementing this, but want to get your opinion before starting to write code.
In napari we would like to make keybindings configurable via settings.
However, the application has only one register of shortcuts.
Also the
QModelMenulogic depends onself._app.keybindings(inQCommandAction) to build menu.My proposition is to add a
Application.default_keybindingsproperty to get public access to the default registered keybindings. Then allow the user in the subclass to overwrite thekeybindingsproperty with a custom provider.Then update
QMenuItemAction.createto trigger refreshment of keybinding on rebuild of the menus or other action refreshment. (also add proper method toQCommandActionto be called).What did you think about that?
I'm open to implementing this, but want to get your opinion before starting to write code.