Commit Graph

8 Commits

Author SHA1 Message Date
wmayer
b6f331f4fa modernize C++: use transparent functors 2023-08-07 16:08:35 +02:00
wmayer
91613cc24c Mod: fix some compiler warnings:
* QString::indexOf() is now marked as [[nodiscard]]
* QApplication::fontMetrics() is deprecated, use the constructor of QFontMetricsF
* fix -Wunused-result
* fix -Wunused-but-set-variable
2022-12-31 21:54:45 +01:00
wmayer
bc3c81e138 Gui: fix warnings reported by GH Actions:
* Fix trailing spaces
* Replace tabs
* Mark constructors with one argument explicit
* Fix typos
* Include FCGlobal.h to fix parsing errors
2022-11-11 09:56:43 +01:00
Zheng, Lei
ae8ba0de3d Gui: fix shortcut context handling in ShortcutManager
Related #6097

Qt ignores shortcut of actions in invisible toolbar, but not for actions
in a hidden menu action of menu bar, which is likely a Qt bug. The
desired behavior should be that of toolbar actions, so that actions
belong to different workbenches can have the same shortcut without
conflict.

This commit works around this inconsistency by ensuring only the active
actions are added in menu bar. In addition, all active actions will be
added to a zero sized child widget of the main window, which ensures the
shortcuts of these actions being active regardless whether the action is
in toolbar or menu bar, visible or not.
2022-11-10 23:20:18 +01:00
Zheng, Lei
9d8efe1488 Gui: fix ShortcutManager modifier detection 2022-11-10 23:20:18 +01:00
Zheng, Lei
0a37a85ea2 Minor code change according to suggestions 2022-11-10 23:20:18 +01:00
Zheng, Lei
dfe921672e Fix comment typo 2022-11-10 23:20:18 +01:00
Zheng, Lei
775452cbc0 Gui: add ShortcutManager to unify shortcut handling
Support longest key sequence match with user defined delay (configurable
through 'Customize -> Keyboard -> Key sequence delay').

Support user defined priority to resolve shortcut conflict through
'Customize -> Keyboard')

Add 'All' category in 'Customize -> Keyboard' to list all command and
showing their shortcuts

Unify macro command shortcut setting (BaseApp/Preferences/Shortcut).
2022-11-10 23:20:18 +01:00