Merge pull request #1199 from laanwj/2012_05_signmessage_autoselect
signmessage: auto-select signature when field is focused/clicked
This commit is contained in:
commit
a2de039ec4
2 changed files with 15 additions and 0 deletions
|
@ -31,6 +31,7 @@ MessagePage::MessagePage(QWidget *parent) :
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GUIUtil::setupAddressWidget(ui->signFrom, this);
|
GUIUtil::setupAddressWidget(ui->signFrom, this);
|
||||||
|
ui->signature->installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessagePage::~MessagePage()
|
MessagePage::~MessagePage()
|
||||||
|
@ -117,3 +118,14 @@ void MessagePage::on_clearButton_clicked()
|
||||||
ui->message->clear();
|
ui->message->clear();
|
||||||
ui->signature->clear();
|
ui->signature->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MessagePage::eventFilter(QObject *object, QEvent *event)
|
||||||
|
{
|
||||||
|
if(object == ui->signature && (event->type() == QEvent::MouseButtonPress ||
|
||||||
|
event->type() == QEvent::FocusIn))
|
||||||
|
{
|
||||||
|
ui->signature->selectAll();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return QDialog::eventFilter(object, event);
|
||||||
|
}
|
||||||
|
|
|
@ -23,6 +23,9 @@ public:
|
||||||
|
|
||||||
void setAddress(QString);
|
void setAddress(QString);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool eventFilter(QObject *object, QEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MessagePage *ui;
|
Ui::MessagePage *ui;
|
||||||
WalletModel *model;
|
WalletModel *model;
|
||||||
|
|
Loading…
Reference in a new issue