Skip to content

Commit 01ef0a0

Browse files
committed
Update line edit to new UI guidlines
WE2-997 Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent 189d42a commit 01ef0a0

5 files changed

Lines changed: 35 additions & 57 deletions

File tree

src/ui/dark.qss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ CertificateButton #warn, CertificateWidget #warn {
3030
color: #F54A67;
3131
}
3232
QLineEdit {
33-
background-color: rgba(255,255,255,0.1);
34-
border-color: #008EEA;
33+
border-color: #909299;
34+
color: #FFFFFF;
3535
}
3636
QLineEdit[warning="true"] {
37-
border-color: #F54A67;
38-
color: #F54A67;
37+
border-color: #FF5C79;
3938
}
4039
QProgressBar {
4140
background-color: rgba(255,255,255,0.1);
@@ -52,7 +51,7 @@ color: #FFFFFF;
5251
color: white;
5352
}
5453
#pinErrorLabel {
55-
color: #F54A67;
54+
color: #FF5C79;
5655
}
5756
#aboutContent {
5857
border-color: #4E4E53;

src/ui/dialog.ui

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<string notr="true">QWidget {
2424
background-color: white;
2525
font-size: 14px;
26-
font-family: &quot;Roboto&quot;;
26+
font-family: Roboto, Helvetica;
2727
color: black;
2828
}
2929
QPushButton {
@@ -83,24 +83,16 @@ CertificateButton #warn, CertificateWidget #warn {
8383
color: #CD2541;
8484
}
8585
QLineEdit {
86-
border: 2px solid #113F8E;
87-
color: #113F8E;
88-
border-radius: 3px;
89-
min-width: 200px;
90-
min-height: 45px;
91-
max-width: 200px;
92-
max-height: 45px;
93-
font-size: 26px;
94-
font-weight: bold;
95-
padding-right: 14px;
96-
padding-left: 14px;
97-
padding-top: 0px;
98-
padding-bottom: 0px;
86+
border: 1px solid #C4CBD8;
87+
color: #607496;
88+
border-radius: 8px;
89+
font-size: 16px;
90+
padding: 10px 14px;
9991
lineedit-password-character: 42;
10092
}
10193
QLineEdit[warning=&quot;true&quot;] {
102-
border: 2px solid #CD2541;
103-
color: #CD2541;
94+
border: 1px solid #AD2A45;
95+
color: #07142A;
10496
}
10597
QProgressBar {
10698
height: 30px;
@@ -127,10 +119,12 @@ color: #003168;
127119
font-weight: bold;
128120
max-height: 20px;
129121
}
130-
#pinTitleLabel, #pinErrorLabel {
131-
max-height: 20px;
122+
#pinTitleLabel {
123+
font-size: 14px;
124+
color: #07142A;
132125
}
133126
#pinErrorLabel {
127+
font-size: 14px;
134128
color: #CD2541;
135129
}
136130
#fatalError {
@@ -564,29 +558,19 @@ border-radius: 4px;</string>
564558
<item>
565559
<layout class="QVBoxLayout" name="pinLayout">
566560
<property name="spacing">
567-
<number>10</number>
561+
<number>6</number>
568562
</property>
569563
<item>
570564
<widget class="QLabel" name="pinTitleLabel">
571-
<property name="font">
572-
<font>
573-
<family>Roboto</family>
574-
<pointsize>-1</pointsize>
575-
<bold>true</bold>
576-
</font>
577-
</property>
578565
<property name="text">
579566
<string notr="true">Enter PIN1 for authentication</string>
580567
</property>
581-
<property name="alignment">
582-
<set>Qt::AlignCenter</set>
583-
</property>
584568
<property name="buddy">
585569
<cstring>pinInput</cstring>
586570
</property>
587571
</widget>
588572
</item>
589-
<item alignment="Qt::AlignHCenter">
573+
<item>
590574
<widget class="QLineEdit" name="pinInput">
591575
<property name="maxLength">
592576
<number>12</number>
@@ -598,21 +582,12 @@ border-radius: 4px;</string>
598582
</item>
599583
<item>
600584
<widget class="QLabel" name="pinErrorLabel">
601-
<property name="minimumSize">
602-
<size>
603-
<width>0</width>
604-
<height>36</height>
605-
</size>
606-
</property>
607585
<property name="focusPolicy">
608586
<enum>Qt::TabFocus</enum>
609587
</property>
610588
<property name="text">
611589
<string notr="true">2 tries left</string>
612590
</property>
613-
<property name="alignment">
614-
<set>Qt::AlignCenter</set>
615-
</property>
616591
<property name="wordWrap">
617592
<bool>true</bool>
618593
</property>
@@ -635,19 +610,6 @@ border-radius: 4px;</string>
635610
</property>
636611
</widget>
637612
</item>
638-
<item>
639-
<spacer name="pinSpacer">
640-
<property name="orientation">
641-
<enum>Qt::Vertical</enum>
642-
</property>
643-
<property name="sizeHint" stdset="0">
644-
<size>
645-
<width>20</width>
646-
<height>5</height>
647-
</size>
648-
</property>
649-
</spacer>
650-
</item>
651613
</layout>
652614
</item>
653615
</layout>

src/ui/images/alert.svg

Lines changed: 3 additions & 0 deletions
Loading

src/ui/images/alert_dark.svg

Lines changed: 3 additions & 0 deletions
Loading

src/ui/webeiddialog.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ using namespace electronic_id;
6262
class WebEidDialog::Private : public Ui::WebEidDialog
6363
{
6464
public:
65+
observer_ptr<QSvgWidget> pinInputAlert;
6566
observer_ptr<QRegularExpressionValidator> pinInputValidator;
6667
observer_ptr<QTimeLine> pinTimeoutTimer;
6768
observer_ptr<QButtonGroup> selectionGroup;
@@ -103,6 +104,15 @@ WebEidDialog::WebEidDialog(QWidget* parent) : WebEidUI(parent), ui(new Private)
103104
auto pinInputFont = ui->pinInput->font();
104105
pinInputFont.setLetterSpacing(QFont::AbsoluteSpacing, 2);
105106
ui->pinInput->setFont(pinInputFont);
107+
ui->pinInputAlert = new QSvgWidget(ui->pinInput);
108+
ui->pinInputAlert->load(Application::isDarkTheme() ? u":/images/alert_dark.svg"_s
109+
: u":/images/alert.svg"_s);
110+
ui->pinInputAlert->setFixedSize(20, 20);
111+
ui->pinInputAlert->hide();
112+
auto *pinInputLayout = new QHBoxLayout(ui->pinInput);
113+
pinInputLayout->setContentsMargins(10, 10, 10, 10);
114+
pinInputLayout->setSpacing(0);
115+
pinInputLayout->addWidget(ui->pinInputAlert, 0, Qt::AlignRight);
106116

107117
ui->waitingSpinner->load(Application::isDarkTheme() ? u":/images/wait_dark.svg"_s
108118
: u":/images/wait.svg"_s);
@@ -679,6 +689,7 @@ void WebEidDialog::showPinInputWarning(bool show)
679689
{
680690
style()->unpolish(ui->pinInput);
681691
ui->pinInput->setProperty("warning", show);
692+
ui->pinInputAlert->setVisible(show);
682693
style()->polish(ui->pinInput);
683694
}
684695

0 commit comments

Comments
 (0)