From ed62184d6170e34b92a0d9d4329298e142de24f7 Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Sun, 20 Oct 2024 22:18:31 +0500 Subject: [PATCH] qt: Make the About dialog closeable with Esc key (#4912) --- src/qt/qt_mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index b06473a8a..3ee58f23b 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -1725,7 +1725,8 @@ MainWindow::on_actionAbout_86Box_triggered() msgBox.setText(QString("%3%1%2").arg(EMU_VERSION_FULL, versioninfo, tr("86Box v"))); msgBox.setInformativeText(tr("An emulator of old computers\n\nAuthors: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, and others.\n\nWith previous core contributions from Sarah Walker, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2 or later. See LICENSE for more information.")); msgBox.setWindowTitle("About 86Box"); - msgBox.addButton("OK", QMessageBox::ButtonRole::AcceptRole); + const auto closeButton = msgBox.addButton("OK", QMessageBox::ButtonRole::AcceptRole); + msgBox.setEscapeButton(closeButton); const auto webSiteButton = msgBox.addButton(EMU_SITE, QMessageBox::ButtonRole::HelpRole); webSiteButton->connect(webSiteButton, &QPushButton::released, []() { QDesktopServices::openUrl(QUrl("https://" EMU_SITE));