Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 4ec49f8

Browse files
committed
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.
1 parent 4227a8e commit 4ec49f8

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

src/qt/receivecoinsdialog.cpp

-16
Original file line numberDiff line numberDiff line change
@@ -242,22 +242,6 @@ void ReceiveCoinsDialog::resizeEvent(QResizeEvent *event)
242242
columnResizingFixer->stretchColumnWidth(RecentRequestsTableModel::Message);
243243
}
244244

245-
void ReceiveCoinsDialog::keyPressEvent(QKeyEvent *event)
246-
{
247-
if (event->key() == Qt::Key_Return)
248-
{
249-
// press return -> submit form
250-
if (ui->reqLabel->hasFocus() || ui->reqAmount->hasFocus() || ui->reqMessage->hasFocus())
251-
{
252-
event->ignore();
253-
on_receiveButton_clicked();
254-
return;
255-
}
256-
}
257-
258-
this->QDialog::keyPressEvent(event);
259-
}
260-
261245
QModelIndex ReceiveCoinsDialog::selectedRow()
262246
{
263247
if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())

src/qt/receivecoinsdialog.h

-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ public Q_SLOTS:
4949
void reject() override;
5050
void accept() override;
5151

52-
protected:
53-
virtual void keyPressEvent(QKeyEvent *event) override;
54-
5552
private:
5653
Ui::ReceiveCoinsDialog *ui;
5754
GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;

0 commit comments

Comments
 (0)