diff options
author | Kenneth Chew <kenneth.c0@protonmail.com> | 2022-04-16 02:07:29 -0400 |
---|---|---|
committer | Kenneth Chew <kenneth.c0@protonmail.com> | 2022-04-16 02:07:29 -0400 |
commit | e59d3a339fcba0d17fd70df5690d358d1da315ac (patch) | |
tree | 421685cb66ad636af38b6751072dfe27a08d999a /launcher/ui/MainWindow.cpp | |
parent | 1049507b3fe1b103e3089bb1178cac3bc92ff964 (diff) | |
download | PrismLauncher-e59d3a339fcba0d17fd70df5690d358d1da315ac.tar.gz PrismLauncher-e59d3a339fcba0d17fd70df5690d358d1da315ac.tar.bz2 PrismLauncher-e59d3a339fcba0d17fd70df5690d358d1da315ac.zip |
Close the current window instead of the main window from the menu bar
Systems with native menu bars show the same menu bar for all child windows. As a result, you cannot assume that the menu bar's parent (the `MainWindow`) will be the window in focus.
Diffstat (limited to 'launcher/ui/MainWindow.cpp')
-rw-r--r-- | launcher/ui/MainWindow.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 90af763a..1c694484 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -615,8 +615,7 @@ public: closeAct = new QAction(tr("Close &Window"), MainWindow); closeAct->setShortcut(QKeySequence::Close); closeAct->setStatusTip(tr("Close the current window")); - // FIXME: currently this always closes the main window, even if it is not currently the window in focus - connect(closeAct, &QAction::triggered, MainWindow, &MainWindow::close); + connect(closeAct, &QAction::triggered, APPLICATION, &Application::closeCurrentWindow); undoAct = new QAction(tr("&Undo"), MainWindow); undoAct->setShortcuts(QKeySequence::Undo); |