aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHennadii Stepanov <[email protected]>2020-07-21 21:29:09 +0300
committerHennadii Stepanov <[email protected]>2020-07-21 21:29:09 +0300
commit4ec49f8d1e25b330e6a0f79ae897d98d29ff32f9 (patch)
tree18047a0ecd63c9fbe1288821f9b8d071c911f44c
parentqt: Make "Create new receiving address" default unconditionally (diff)
downloaddiscoin-4ec49f8d1e25b330e6a0f79ae897d98d29ff32f9.tar.xz
discoin-4ec49f8d1e25b330e6a0f79ae897d98d29ff32f9.zip
qt: Leverage the default "Create new receiving address" button
When Enter or Return is pressed the default button will be always clicked. All buttons can always be clicked from the keyboard by pressing spacebar when the button has focus.
-rw-r--r--src/qt/receivecoinsdialog.cpp16
-rw-r--r--src/qt/receivecoinsdialog.h3
2 files changed, 0 insertions, 19 deletions
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp
index 5debded4e..d374d610e 100644
--- a/src/qt/receivecoinsdialog.cpp
+++ b/src/qt/receivecoinsdialog.cpp
@@ -242,22 +242,6 @@ void ReceiveCoinsDialog::resizeEvent(QResizeEvent *event)
columnResizingFixer->stretchColumnWidth(RecentRequestsTableModel::Message);
}
-void ReceiveCoinsDialog::keyPressEvent(QKeyEvent *event)
-{
- if (event->key() == Qt::Key_Return)
- {
- // press return -> submit form
- if (ui->reqLabel->hasFocus() || ui->reqAmount->hasFocus() || ui->reqMessage->hasFocus())
- {
- event->ignore();
- on_receiveButton_clicked();
- return;
- }
- }
-
- this->QDialog::keyPressEvent(event);
-}
-
QModelIndex ReceiveCoinsDialog::selectedRow()
{
if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())
diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h
index 2f48cd58f..27455e290 100644
--- a/src/qt/receivecoinsdialog.h
+++ b/src/qt/receivecoinsdialog.h
@@ -49,9 +49,6 @@ public Q_SLOTS:
void reject() override;
void accept() override;
-protected:
- virtual void keyPressEvent(QKeyEvent *event) override;
-
private:
Ui::ReceiveCoinsDialog *ui;
GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;