diff options
author | David Redondo <kde@david-redondo.de> | 2020-07-03 09:23:56 +0200 |
---|---|---|
committer | David Redondo <kde@david-redondo.de> | 2020-08-12 13:53:18 +0000 |
commit | c032237955343f4a9c8ba67434dc4198d1ceece2 (patch) | |
tree | 061aa5b0c8f53d2d406fcf65cac919b630eb75f1 /src/gui/kstandardshortcut.h | |
parent | 45d8532f09fbefa14cfaf4d76b7a9672d27e104f (diff) | |
download | kconfig-c032237955343f4a9c8ba67434dc4198d1ceece2.tar.gz kconfig-c032237955343f4a9c8ba67434dc4198d1ceece2.tar.bz2 |
Categorize standard shortcuts
We have a huge amount of standard shortcuts. By adding the ability to divide
them into categories, they can be presented to the user in a way that enables
them to easier find the shortcut that they want. Internally some shortcuts were
already grouped but that seems to have stopped for the later additions. (The
related standard actions from KConfigWidgets also seem to have this not exposed
internal grouping.)
See plasma-desktop!26
Diffstat (limited to 'src/gui/kstandardshortcut.h')
-rw-r--r-- | src/gui/kstandardshortcut.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/kstandardshortcut.h b/src/gui/kstandardshortcut.h index cda9fe96..89d1fe9b 100644 --- a/src/gui/kstandardshortcut.h +++ b/src/gui/kstandardshortcut.h @@ -148,6 +148,20 @@ enum StandardShortcut { }; /** + * Categories in which the standard shortcuts can be classified + * @since 5.74 + */ +enum class Category { + InvalidCategory = -1, + File, + Edit, + Navigation, + View, + Settings, + Help, +}; + +/** * Returns the keybinding for @p accel. * On X11, if QApplication was initialized with GUI disabled, the * default keybinding will always be returned. @@ -224,6 +238,12 @@ KCONFIGGUI_EXPORT QList<QKeySequence> hardcodedDefaultShortcut(StandardShortcut KCONFIGGUI_EXPORT void saveShortcut(StandardShortcut id, const QList<QKeySequence> &newShortcut); /** + * Returns the appropriate category for the given StandardShortcut \p id. + * @since 5.73 + */ +KCONFIGGUI_EXPORT Category category(StandardShortcut id); + +/** * Open file. Default: Ctrl-o * @return the shortcut of the standard accelerator */ |