Skip to content

Commit d070827

Browse files
metsmamrts
authored andcommitted
Use word wrap
WE2-767 Signed-off-by: Raul Metsma <[email protected]>
1 parent 5929a35 commit d070827

File tree

3 files changed

+88
-79
lines changed

3 files changed

+88
-79
lines changed

src/ui/certificatewidget.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,24 @@ CertificateWidgetInfo::CertificateWidgetInfo(QWidget* self) :
4747
icon(new QLabel(self)), info(new QLabel(self)), warnIcon(new QLabel(self)),
4848
warn(new QLabel(CertificateWidget::tr("Pin locked"), self))
4949
{
50-
icon->setPixmap(QStringLiteral(":/images/id-card.svg"));
51-
warnIcon->setPixmap(QStringLiteral(":/images/fatal.svg"));
52-
if (qApp->isDarkTheme()) {
50+
if (Application::isDarkTheme()) {
5351
icon->setPixmap(QStringLiteral(":/images/id-card_dark.svg"));
5452
warnIcon->setPixmap(QStringLiteral(":/images/fatal_dark.svg"));
53+
} else {
54+
icon->setPixmap(QStringLiteral(":/images/id-card.svg"));
55+
warnIcon->setPixmap(QStringLiteral(":/images/fatal.svg"));
5556
}
5657
warnIcon->hide();
5758
warnIcon->installEventFilter(self);
5859
warn->setObjectName(QStringLiteral("warn"));
5960
warn->hide();
60-
QHBoxLayout* layout = new QHBoxLayout(self);
61+
auto* layout = new QHBoxLayout(self);
6162
layout->setContentsMargins(20, 0, 20, 0);
62-
layout->setSpacing(20);
63+
layout->setSpacing(10);
6364
layout->addWidget(icon);
6465
layout->addWidget(info, 1);
6566
layout->addWidget(warnIcon);
66-
QHBoxLayout* warnLayout = new QHBoxLayout;
67+
auto* warnLayout = new QHBoxLayout;
6768
warnLayout->setSpacing(6);
6869
warnLayout->addWidget(warnIcon);
6970
warnLayout->addWidget(warn);
@@ -91,7 +92,7 @@ void CertificateWidgetInfo::setCertificateInfo(const CardCertificateAndPinInfo&
9192
{
9293
warn->setText(CertificateWidget::tr("Pin locked"));
9394
certAndPinInfo = cardCertPinInfo;
94-
const auto certInfo = cardCertPinInfo.certInfo;
95+
const auto& certInfo = cardCertPinInfo.certInfo;
9596
QString warning, effectiveDate = certInfo.effectiveDate, expiryDate = certInfo.expiryDate;
9697
if (certInfo.notEffective) {
9798
effectiveDate = displayInRed(effectiveDate);

src/ui/dialog.ui

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>500</width>
10-
<height>495</height>
9+
<width>550</width>
10+
<height>510</height>
1111
</rect>
1212
</property>
1313
<property name="minimumSize">
1414
<size>
15-
<width>500</width>
15+
<width>550</width>
1616
<height>0</height>
1717
</size>
1818
</property>
@@ -527,7 +527,7 @@ height: 24px;
527527
<enum>Qt::TabFocus</enum>
528528
</property>
529529
<property name="text">
530-
<string>Authenticate</string>
530+
<string notr="true">Authenticate</string>
531531
</property>
532532
</widget>
533533
</item>
@@ -545,7 +545,7 @@ height: 24px;
545545
<enum>Qt::TabFocus</enum>
546546
</property>
547547
<property name="text">
548-
<string>By authenticating, I agree to the transfer of my name and personal identification code to the service provider.</string>
548+
<string notr="true">By authenticating, I agree to the transfer of my name and personal identification code to the service provider.</string>
549549
</property>
550550
<property name="wordWrap">
551551
<bool>true</bool>
@@ -569,49 +569,48 @@ height: 24px;
569569
</layout>
570570
</item>
571571
<item>
572-
<layout class="QVBoxLayout" name="pinInputPageContentLayout">
573-
<property name="spacing">
572+
<layout class="QGridLayout" name="pinInputPageContentLayout">
573+
<property name="horizontalSpacing">
574+
<number>0</number>
575+
</property>
576+
<property name="verticalSpacing">
574577
<number>8</number>
575578
</property>
576-
<item>
579+
<item row="0" column="0" colspan="2">
577580
<widget class="CertificateWidget" name="pinInputCertificateInfo" native="true"/>
578581
</item>
579-
<item>
580-
<layout class="QHBoxLayout" name="selectAnotherCertificateLayout">
581-
<item>
582-
<widget class="QToolButton" name="selectAnotherCertificate">
583-
<property name="text">
584-
<string>Select another certificate</string>
585-
</property>
586-
<property name="icon">
587-
<iconset resource="web-eid-resources.qrc">
588-
<normaloff>:/images/left.svg</normaloff>:/images/left.svg</iconset>
589-
</property>
590-
<property name="iconSize">
591-
<size>
592-
<width>24</width>
593-
<height>24</height>
594-
</size>
595-
</property>
596-
<property name="toolButtonStyle">
597-
<enum>Qt::ToolButtonTextBesideIcon</enum>
598-
</property>
599-
</widget>
600-
</item>
601-
<item>
602-
<spacer name="selectAnotherCertificateSpacer">
603-
<property name="orientation">
604-
<enum>Qt::Horizontal</enum>
605-
</property>
606-
<property name="sizeHint" stdset="0">
607-
<size>
608-
<width>40</width>
609-
<height>20</height>
610-
</size>
611-
</property>
612-
</spacer>
613-
</item>
614-
</layout>
582+
<item row="1" column="0">
583+
<widget class="QToolButton" name="selectAnotherCertificate">
584+
<property name="text">
585+
<string>Select another certificate</string>
586+
</property>
587+
<property name="icon">
588+
<iconset resource="web-eid-resources.qrc">
589+
<normaloff>:/images/left.svg</normaloff>:/images/left.svg</iconset>
590+
</property>
591+
<property name="iconSize">
592+
<size>
593+
<width>24</width>
594+
<height>24</height>
595+
</size>
596+
</property>
597+
<property name="toolButtonStyle">
598+
<enum>Qt::ToolButtonTextBesideIcon</enum>
599+
</property>
600+
</widget>
601+
</item>
602+
<item row="1" column="1">
603+
<spacer name="selectAnotherCertificateSpacer">
604+
<property name="orientation">
605+
<enum>Qt::Horizontal</enum>
606+
</property>
607+
<property name="sizeHint" stdset="0">
608+
<size>
609+
<width>40</width>
610+
<height>0</height>
611+
</size>
612+
</property>
613+
</spacer>
615614
</item>
616615
</layout>
617616
</item>
@@ -630,7 +629,7 @@ height: 24px;
630629
</font>
631630
</property>
632631
<property name="text">
633-
<string>Enter PIN1 for authentication</string>
632+
<string notr="true">Enter PIN1 for authentication</string>
634633
</property>
635634
<property name="alignment">
636635
<set>Qt::AlignCenter</set>
@@ -652,6 +651,12 @@ height: 24px;
652651
</item>
653652
<item>
654653
<widget class="QLabel" name="pinErrorLabel">
654+
<property name="minimumSize">
655+
<size>
656+
<width>0</width>
657+
<height>36</height>
658+
</size>
659+
</property>
655660
<property name="focusPolicy">
656661
<enum>Qt::TabFocus</enum>
657662
</property>
@@ -661,6 +666,9 @@ height: 24px;
661666
<property name="alignment">
662667
<set>Qt::AlignCenter</set>
663668
</property>
669+
<property name="wordWrap">
670+
<bool>true</bool>
671+
</property>
664672
</widget>
665673
</item>
666674
<item>
@@ -688,7 +696,7 @@ height: 24px;
688696
<property name="sizeHint" stdset="0">
689697
<size>
690698
<width>20</width>
691-
<height>0</height>
699+
<height>5</height>
692700
</size>
693701
</property>
694702
</spacer>

0 commit comments

Comments
 (0)