mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 21:12:29 +02:00
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.
This commit is contained in:
parent
4227a8e1f3
commit
4ec49f8d1e
@ -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())
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user