From c032237955343f4a9c8ba67434dc4198d1ceece2 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Fri, 3 Jul 2020 09:23:56 +0200 Subject: 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 --- src/gui/kstandardshortcut.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/gui/kstandardshortcut.h') 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 @@ -147,6 +147,20 @@ enum StandardShortcut { StandardShortcutCount // number of standard shortcuts }; +/** + * 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 @@ -223,6 +237,12 @@ KCONFIGGUI_EXPORT QList hardcodedDefaultShortcut(StandardShortcut */ KCONFIGGUI_EXPORT void saveShortcut(StandardShortcut id, const QList &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 -- cgit v1.2.1