diff options
| author | Al <26797547+Al12rs@users.noreply.github.com> | 2021-10-13 13:12:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-13 13:12:21 +0200 |
| commit | 081fa3ec93668ef3944c70c5de422d51c667acf4 (patch) | |
| tree | 57deb6f7d3545868d0631cadefd90fd4a042d7ed /src/mainwindow.cpp | |
| parent | b5800435aa0c2396194f9e287d27a20c0e89203d (diff) | |
| parent | b261f3a1e57babc0e05dc7eae037c9dc3adf6ca7 (diff) | |
Merge pull request #1588 from Qudix/menubar_alt
Add a toggle for the Alt key showing the menubar
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4d1c16ac..a7d7bddb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3645,10 +3645,14 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event) { // if the ui is locked, ignore the ALT key event // alt-tabbing out of a game triggers this - if (!UILocker::instance().locked()) { - // if the menubar is hidden, pressing Alt will make it visible + auto& uilocker = UILocker::instance(); + auto& settings = Settings::instance(); + if (!uilocker.locked()) { + // if the menubar is hidden and showMenuBarOnAlt is true, + // pressing Alt will make it visible if (event->key() == Qt::Key_Alt) { - if (!ui->menuBar->isVisible()) { + bool showMenubarOnAlt = settings.interface().showMenubarOnAlt(); + if (showMenubarOnAlt && !ui->menuBar->isVisible()) { ui->menuBar->show(); } } |
