Enable shortcuts with buttons invisible (#1580) (#1800)

* Make `ShortcutsWidget` load all shortcuts

`ShortcutsWidget" now loads shortcuts for all capture widgets,
regardless of enabled state in 'Interface settings'.

Also removed unnecessary indirection which made the API confusing:

- Removed `ConfigHandler::setShortcutsDefault` which was only called
  once on a temporary `ConfigHandler` and hence had no effect

- Removed function `ConfigHandler::shortcuts`

- `ShortcutsWidget` now calls `ConfigShortcuts::captureShortcutsDefault`
  directly instead of through `ConfigHandler::shortcuts`

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Enable shortcuts for hidden buttons

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix crash if ButtonHandler has no buttons

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* obligatory clang-format

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
This commit is contained in:
Haris Gušić
2021-08-04 18:03:19 +02:00
committed by GitHub
parent 852b8c3fb7
commit 1c4f3bdb39
6 changed files with 22 additions and 34 deletions

View File

@@ -64,9 +64,6 @@ Controller::Controller()
m_appLatestVersion = QStringLiteral(APP_VERSION).replace("v", "");
qApp->setQuitOnLastWindowClosed(false);
// set default shortcusts if not set yet
ConfigHandler().setShortcutsDefault();
// init tray icon
#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
if (!ConfigHandler().disabledTrayIconValue()) {