From acf1730093c050a3316047eca66ca0cbb2f88a20 Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Sat, 11 Sep 2021 20:42:20 -0500 Subject: Add a toggle for the Alt key showing the menubar --- src/mainwindow.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/mainwindow.cpp') 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(); } } -- cgit v1.3.1