mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge #15768: gui: Add close window shortcut
f5a3a5b9ab362c58fa424261f313aa9cf46d2a98 gui: Add close window shortcut (Miguel Herranz) Pull request description: CMD+W is the standard shortcut in macOS to close a window without exiting the program. This adds support to use the shortcut in both main and debug windows. ACKs for top commit: jonasschnelli: Tested ACK f5a3a5b9ab362c58fa424261f313aa9cf46d2a98 hebasto: ACK f5a3a5b9ab362c58fa424261f313aa9cf46d2a98, tested on Linux Mint 19.3 by manually opening available dialogs and sub-windows, and applying the `Ctrl+W` shortcut. Also tested with "Minimize on close" option enabled / disabled. Tree-SHA512: 39851f6680cf97c334d5759c6f8597cb45685359417493ff8b0566672edbd32303fa15ac4260ec8ab5ea1458a600a329153014f25609e1db9cf399aa851ae2f9
This commit is contained in:
parent
5564cf6906
commit
41dddafa8f
@ -139,6 +139,8 @@ AddressBookPage::AddressBookPage(Mode _mode, Tabs _tab, QWidget* parent) :
|
||||
GUIUtil::updateFonts();
|
||||
|
||||
GUIUtil::disableMacFocusRect(this);
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
AddressBookPage::~AddressBookPage()
|
||||
|
@ -91,6 +91,8 @@ AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent, SecureStri
|
||||
connect(ui->passEdit1, &QLineEdit::textChanged, this, &AskPassphraseDialog::textChanged);
|
||||
connect(ui->passEdit2, &QLineEdit::textChanged, this, &AskPassphraseDialog::textChanged);
|
||||
connect(ui->passEdit3, &QLineEdit::textChanged, this, &AskPassphraseDialog::textChanged);
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
AskPassphraseDialog::~AskPassphraseDialog()
|
||||
|
@ -238,6 +238,8 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const NetworkStyle* networkStyle,
|
||||
});
|
||||
timerCustomCss->start(200);
|
||||
}
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
BitcoinGUI::~BitcoinGUI()
|
||||
|
@ -160,6 +160,8 @@ CoinControlDialog::CoinControlDialog(CCoinControl& coin_control, WalletModel* _m
|
||||
updateLabelLocked();
|
||||
CoinControlDialog::updateLabels(m_coin_control, _model, this);
|
||||
}
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
CoinControlDialog::~CoinControlDialog()
|
||||
|
@ -45,6 +45,8 @@ EditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) :
|
||||
GUIUtil::ItemDelegate* delegate = new GUIUtil::ItemDelegate(mapper);
|
||||
connect(delegate, &GUIUtil::ItemDelegate::keyEscapePressed, this, &EditAddressDialog::reject);
|
||||
mapper->setItemDelegate(delegate);
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
EditAddressDialog::~EditAddressDialog()
|
||||
|
@ -67,6 +67,7 @@
|
||||
#include <QSettings>
|
||||
#include <QSize>
|
||||
#include <QString>
|
||||
#include <QShortcut>
|
||||
#include <QTextDocument> // for Qt::mightBeRichText
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
@ -602,6 +603,11 @@ void bringToFront(QWidget* w)
|
||||
}
|
||||
}
|
||||
|
||||
void handleCloseWindowShortcut(QWidget* w)
|
||||
{
|
||||
QObject::connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), w), &QShortcut::activated, w, &QWidget::close);
|
||||
}
|
||||
|
||||
void openDebugLogfile()
|
||||
{
|
||||
fs::path pathDebug = GetDataDir() / "debug.log";
|
||||
|
@ -193,6 +193,9 @@ namespace GUIUtil
|
||||
// Activate, show and raise the widget
|
||||
void bringToFront(QWidget* w);
|
||||
|
||||
// Set shortcut to close window
|
||||
void handleCloseWindowShortcut(QWidget* w);
|
||||
|
||||
// Open debug.log
|
||||
void openDebugLogfile();
|
||||
|
||||
|
@ -18,6 +18,8 @@ OpenURIDialog::OpenURIDialog(QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
GUIUtil::updateFonts();
|
||||
GUIUtil::disableMacFocusRect(this);
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
OpenURIDialog::~OpenURIDialog()
|
||||
|
@ -202,6 +202,8 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
|
||||
ui->minimizeToTray->setChecked(false);
|
||||
ui->minimizeToTray->setEnabled(false);
|
||||
}
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
OptionsDialog::~OptionsDialog()
|
||||
|
@ -33,6 +33,8 @@ ReceiveRequestDialog::ReceiveRequestDialog(QWidget *parent) :
|
||||
#endif
|
||||
|
||||
connect(ui->btnSaveAs, &QPushButton::clicked, ui->lblQRCode, &QRImageWidget::saveImage);
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
ReceiveRequestDialog::~ReceiveRequestDialog()
|
||||
|
@ -528,6 +528,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, QWidget* parent, Qt::WindowFlags
|
||||
showPage(ToUnderlying(TabTypes::INFO));
|
||||
|
||||
reloadThemedWidgets();
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
RPCConsole::~RPCConsole()
|
||||
|
@ -60,6 +60,8 @@ SignVerifyMessageDialog::SignVerifyMessageDialog(QWidget* parent) :
|
||||
GUIUtil::updateFonts();
|
||||
|
||||
GUIUtil::disableMacFocusRect(this);
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
SignVerifyMessageDialog::~SignVerifyMessageDialog()
|
||||
|
@ -135,6 +135,8 @@ SplashScreen::SplashScreen(interfaces::Node& node, const NetworkStyle *networkSt
|
||||
|
||||
subscribeToCoreSignals();
|
||||
installEventFilter(this);
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
SplashScreen::~SplashScreen()
|
||||
|
@ -2,10 +2,10 @@
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <qt/guiutil.h>
|
||||
#include <qt/transactiondescdialog.h>
|
||||
#include <qt/forms/ui_transactiondescdialog.h>
|
||||
|
||||
#include <qt/guiutil.h>
|
||||
#include <qt/transactiontablemodel.h>
|
||||
|
||||
#include <QModelIndex>
|
||||
@ -21,6 +21,8 @@ TransactionDescDialog::TransactionDescDialog(const QModelIndex &idx, QWidget *pa
|
||||
setWindowTitle(tr("Details for %1").arg(idx.data(TransactionTableModel::TxHashRole).toString()));
|
||||
QString desc = idx.data(TransactionTableModel::LongDescriptionRole).toString();
|
||||
ui->detailText->setHtml(desc);
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
TransactionDescDialog::~TransactionDescDialog()
|
||||
|
@ -146,6 +146,8 @@ For more information, see the <a style=\"%2\" href=\"%3\">%1 documentation</a>."
|
||||
ui->aboutMessage->setWordWrap(true);
|
||||
ui->helpMessage->setVisible(false);
|
||||
}
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
HelpMessageDialog::~HelpMessageDialog()
|
||||
@ -189,6 +191,8 @@ ShutdownWindow::ShutdownWindow(interfaces::Node& node, QWidget *parent, Qt::Wind
|
||||
setLayout(layout);
|
||||
|
||||
GUIUtil::updateFonts();
|
||||
|
||||
GUIUtil::handleCloseWindowShortcut(this);
|
||||
}
|
||||
|
||||
QWidget* ShutdownWindow::showShutdownWindow(interfaces::Node& node, QMainWindow* window)
|
||||
|
Loading…
Reference in New Issue
Block a user