Skip to content

Commit e0a25c5

Browse files
committed
qt: Make askpassphrase dialog behave more sanely
Set minimum sizes appropriately, and make sure that they are enforced. Replaces #5226.
1 parent b5d1b10 commit e0a25c5

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/qt/askpassphrasedialog.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :
2323
{
2424
ui->setupUi(this);
2525

26+
ui->passEdit1->setMinimumSize(ui->passEdit1->sizeHint());
27+
ui->passEdit2->setMinimumSize(ui->passEdit2->sizeHint());
28+
ui->passEdit3->setMinimumSize(ui->passEdit3->sizeHint());
29+
2630
ui->passEdit1->setMaxLength(MAX_PASSPHRASE_SIZE);
2731
ui->passEdit2->setMaxLength(MAX_PASSPHRASE_SIZE);
2832
ui->passEdit3->setMaxLength(MAX_PASSPHRASE_SIZE);
@@ -35,9 +39,9 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :
3539
switch(mode)
3640
{
3741
case Encrypt: // Ask passphrase x2
42+
ui->warningLabel->setText(tr("Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>."));
3843
ui->passLabel1->hide();
3944
ui->passEdit1->hide();
40-
ui->warningLabel->setText(tr("Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>."));
4145
setWindowTitle(tr("Encrypt wallet"));
4246
break;
4347
case Unlock: // Ask passphrase
@@ -61,7 +65,6 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :
6165
ui->warningLabel->setText(tr("Enter the old and new passphrase to the wallet."));
6266
break;
6367
}
64-
6568
textChanged();
6669
connect(ui->passEdit1, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
6770
connect(ui->passEdit2, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));

src/qt/forms/askpassphrasedialog.ui

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>598</width>
10-
<height>198</height>
10+
<height>222</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -26,8 +26,14 @@
2626
<string>Passphrase Dialog</string>
2727
</property>
2828
<layout class="QVBoxLayout" name="verticalLayout">
29+
<property name="sizeConstraint">
30+
<enum>QLayout::SetMinimumSize</enum>
31+
</property>
2932
<item>
3033
<widget class="QLabel" name="warningLabel">
34+
<property name="text">
35+
<string notr="true">Placeholder text</string>
36+
</property>
3137
<property name="textFormat">
3238
<enum>Qt::RichText</enum>
3339
</property>
@@ -38,6 +44,9 @@
3844
</item>
3945
<item>
4046
<layout class="QFormLayout" name="formLayout">
47+
<property name="sizeConstraint">
48+
<enum>QLayout::SetMinimumSize</enum>
49+
</property>
4150
<property name="fieldGrowthPolicy">
4251
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
4352
</property>

0 commit comments

Comments
 (0)