Merge pull request #1068 from sgourdas/feature/fullscreen_shortcut

On undefined fullscreen key sequence, hardcode to F11
This commit is contained in:
Kelson 2024-03-22 10:23:38 +01:00 committed by GitHub
commit 398a4fcbe3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -413,8 +413,11 @@ void KiwixApp::createActions()
mpa_actions[FindInPageAction]->setShortcuts({QKeySequence::Find, Qt::Key_F3});
connect(mpa_actions[FindInPageAction], &QAction::triggered,
this, [=]() { getTabWidget()->openFindInPageBar(); });
CREATE_ACTION_ICON_SHORTCUT(ToggleFullscreenAction, "full-screen-enter", gt("set-fullscreen"), QKeySequence::FullScreen);
const auto fullScreenKeySeq = QKeySequence(QKeySequence::FullScreen).isEmpty()
? Qt::Key_F11
: QKeySequence::FullScreen;
CREATE_ACTION_ICON_SHORTCUT(ToggleFullscreenAction, "full-screen-enter", gt("set-fullscreen"), fullScreenKeySeq);
connect(mpa_actions[ToggleFullscreenAction], &QAction::toggled,
this, [=](bool checked) {
auto action = mpa_actions[ToggleFullscreenAction];