mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Automatically refocus on new SendCoinsEntrys and scroll to them.
This commit is contained in:
parent
96d3bcb996
commit
9a93c4c024
@ -11,6 +11,7 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
|
#include <QScrollBar>
|
||||||
|
|
||||||
SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
|
SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
@ -188,6 +189,12 @@ SendCoinsEntry *SendCoinsDialog::addEntry()
|
|||||||
|
|
||||||
// Focus the field, so that entry can start immediately
|
// Focus the field, so that entry can start immediately
|
||||||
entry->clear();
|
entry->clear();
|
||||||
|
entry->setFocus();
|
||||||
|
ui->scrollAreaWidgetContents->resize(ui->scrollAreaWidgetContents->sizeHint());
|
||||||
|
QCoreApplication::instance()->processEvents();
|
||||||
|
QScrollBar* bar = ui->scrollArea->verticalScrollBar();
|
||||||
|
if (bar)
|
||||||
|
bar->setSliderPosition(bar->maximum());
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,3 +151,8 @@ bool SendCoinsEntry::isClear()
|
|||||||
return ui->payTo->text().isEmpty();
|
return ui->payTo->text().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SendCoinsEntry::setFocus()
|
||||||
|
{
|
||||||
|
ui->payTo->setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
QWidget *setupTabChain(QWidget *prev);
|
QWidget *setupTabChain(QWidget *prev);
|
||||||
|
|
||||||
|
void setFocus();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setRemoveEnabled(bool enabled);
|
void setRemoveEnabled(bool enabled);
|
||||||
void clear();
|
void clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user