Skip to content

Commit 509f2ab

Browse files
authored
Make AccordionTitle as QCheckBox and update icons (#1347)
IB-7966 Signed-off-by: Raul Metsma <[email protected]>
1 parent 92570fd commit 509f2ab

21 files changed

+295
-697
lines changed

client/MainWindow.ui

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ background-color: #BFD3E8;
644644
<widget class="QWidget" name="eidPage">
645645
<layout class="QVBoxLayout" name="eidPageLayout">
646646
<property name="spacing">
647-
<number>3</number>
647+
<number>0</number>
648648
</property>
649649
<property name="leftMargin">
650650
<number>0</number>
@@ -659,20 +659,7 @@ background-color: #BFD3E8;
659659
<number>0</number>
660660
</property>
661661
<item>
662-
<widget class="InfoStack" name="infoStack" native="true">
663-
<property name="minimumSize">
664-
<size>
665-
<width>0</width>
666-
<height>172</height>
667-
</size>
668-
</property>
669-
<property name="maximumSize">
670-
<size>
671-
<width>16777215</width>
672-
<height>186</height>
673-
</size>
674-
</property>
675-
</widget>
662+
<widget class="InfoStack" name="infoStack" native="true"/>
676663
</item>
677664
<item>
678665
<widget class="Accordion" name="accordion" native="true"/>

client/dialogs/SignatureDialog.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ SignatureDialog::SignatureDialog(const DigiDocSignature &signature, QWidget *par
3737
d->setupUi( this );
3838
setAttribute(Qt::WA_DeleteOnClose);
3939
setWindowFlags(windowFlags()|Qt::FramelessWindowHint);
40-
d->showErrors->init(false, tr("TECHNICAL INFORMATION"), d->error);
4140
d->showErrors->hide();
42-
d->showRole->init(true, tr("ROLE AND ADDRESS"), d->role);
4341
d->error->hide();
44-
connect(d->showErrors, &AccordionTitle::opened, d->showRole, &AccordionTitle::openSection);
45-
connect(d->showErrors, &AccordionTitle::closed, this, [this] { d->showRole->setSectionOpen(); });
46-
connect(d->showRole, &AccordionTitle::opened, d->showErrors, &AccordionTitle::openSection);
47-
connect(d->showRole, &AccordionTitle::closed, this, [this] { d->showErrors->setSectionOpen(); });
42+
connect(d->showErrors, &AccordionTitle::toggled, d->showRole, [this](bool open) {
43+
d->showRole->setChecked(!open);
44+
d->error->setVisible(open);
45+
});
46+
connect(d->showRole, &AccordionTitle::toggled, d->showErrors, [this](bool open) {
47+
d->showErrors->setChecked(!open);
48+
d->role->setVisible(open);
49+
});
4850

4951
new Overlay(this);
5052

client/dialogs/SignatureDialog.ui

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,17 @@ QTextEdit, #signerCity, #signerCountry, #signerState, #signerZip, #signerRoles {
4646
border: 1px solid #8E969D;
4747
border-radius: 2px;
4848
background-color: #FFFFFF;
49-
}
50-
#lblNotice, #info, #error { margin: 0px 12px 0px 12px; }</string>
49+
}</string>
5150
</property>
5251
<layout class="QVBoxLayout" name="leftPaneLayout" stretch="0,0,0,0,1,0,0,0">
5352
<property name="leftMargin">
54-
<number>0</number>
53+
<number>12</number>
5554
</property>
5655
<property name="topMargin">
5756
<number>12</number>
5857
</property>
5958
<property name="rightMargin">
60-
<number>1</number>
59+
<number>12</number>
6160
</property>
6261
<property name="bottomMargin">
6362
<number>0</number>
@@ -95,9 +94,6 @@ background-color: #FFFFFF;
9594
<property name="focusPolicy">
9695
<enum>Qt::TabFocus</enum>
9796
</property>
98-
<property name="styleSheet">
99-
<string notr="true">border: none;</string>
100-
</property>
10197
<property name="text">
10298
<string>Notice</string>
10399
</property>
@@ -108,9 +104,6 @@ background-color: #FFFFFF;
108104
<property name="focusPolicy">
109105
<enum>Qt::TabFocus</enum>
110106
</property>
111-
<property name="styleSheet">
112-
<string notr="true">border: none;</string>
113-
</property>
114107
<property name="wordWrap">
115108
<bool>true</bool>
116109
</property>
@@ -120,10 +113,19 @@ background-color: #FFFFFF;
120113
</widget>
121114
</item>
122115
<item>
123-
<widget class="AccordionTitle" name="showErrors" native="true">
116+
<widget class="AccordionTitle" name="showErrors">
117+
<property name="minimumSize">
118+
<size>
119+
<width>0</width>
120+
<height>40</height>
121+
</size>
122+
</property>
124123
<property name="cursor">
125124
<cursorShape>PointingHandCursor</cursorShape>
126125
</property>
126+
<property name="text">
127+
<string>Technical information</string>
128+
</property>
127129
</widget>
128130
</item>
129131
<item>
@@ -157,23 +159,35 @@ QScrollBar::sub-line:vertical {
157159
</widget>
158160
</item>
159161
<item>
160-
<widget class="AccordionTitle" name="showRole" native="true">
162+
<widget class="AccordionTitle" name="showRole">
163+
<property name="minimumSize">
164+
<size>
165+
<width>0</width>
166+
<height>40</height>
167+
</size>
168+
</property>
161169
<property name="cursor">
162170
<cursorShape>PointingHandCursor</cursorShape>
171+
</property>
172+
<property name="text">
173+
<string>Role and address</string>
174+
</property>
175+
<property name="checked">
176+
<bool>true</bool>
163177
</property>
164178
</widget>
165179
</item>
166180
<item>
167181
<widget class="QWidget" name="role" native="true">
168182
<layout class="QVBoxLayout" name="roleLayout">
169183
<property name="leftMargin">
170-
<number>12</number>
184+
<number>0</number>
171185
</property>
172186
<property name="topMargin">
173187
<number>0</number>
174188
</property>
175189
<property name="rightMargin">
176-
<number>12</number>
190+
<number>0</number>
177191
</property>
178192
<property name="bottomMargin">
179193
<number>0</number>
@@ -554,7 +568,7 @@ QPushButton:disabled {
554568
<customwidgets>
555569
<customwidget>
556570
<class>AccordionTitle</class>
557-
<extends>QWidget</extends>
571+
<extends>QCheckBox</extends>
558572
<header>widgets/AccordionTitle.h</header>
559573
<container>1</container>
560574
</customwidget>

client/dialogs/WarningDialog.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,14 @@ WarningDialog::WarningDialog(const QString &text, const QString &details, QWidge
3939
ui->buttonBox->layout()->setSpacing(40);
4040
ui->text->setText(text);
4141
ui->details->setText(details);
42-
ui->details->setHidden(details.isEmpty());
42+
ui->details->hide();
4343
ui->showDetails->setHidden(details.isEmpty());
44+
connect(ui->showDetails, &AccordionTitle::toggled, ui->details, &QLabel::setVisible);
4445
cancel = ui->buttonBox->button(QDialogButtonBox::Close);
4546
cancel->setCursor(Qt::PointingHandCursor);
4647
connect(cancel, &QPushButton::clicked, this, &QDialog::reject);
4748
resetCancelStyle(true);
4849

49-
if(!details.isEmpty())
50-
ui->showDetails->init(false, tr("Details"), ui->details);
5150
}
5251

5352
WarningDialog::WarningDialog(const QString &text, QWidget *parent)

client/dialogs/WarningDialog.ui

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ border: none;
119119
</widget>
120120
</item>
121121
<item>
122-
<widget class="AccordionTitle" name="showDetails" native="true">
122+
<widget class="AccordionTitle" name="showDetails">
123123
<property name="minimumSize">
124124
<size>
125125
<width>0</width>
@@ -135,6 +135,12 @@ border: none;
135135
<property name="cursor">
136136
<cursorShape>PointingHandCursor</cursorShape>
137137
</property>
138+
<property name="text">
139+
<string>Details</string>
140+
</property>
141+
<property name="checked">
142+
<bool>false</bool>
143+
</property>
138144
</widget>
139145
</item>
140146
<item>
@@ -177,7 +183,7 @@ border: none;
177183
<customwidgets>
178184
<customwidget>
179185
<class>AccordionTitle</class>
180-
<extends>QWidget</extends>
186+
<extends>QCheckBox</extends>
181187
<header>widgets/AccordionTitle.h</header>
182188
<container>1</container>
183189
</customwidget>
Lines changed: 2 additions & 8 deletions
Loading
Lines changed: 2 additions & 8 deletions
Loading

client/images/icon_ajatempel.svg

Lines changed: 0 additions & 1 deletion
Loading

client/images/icon_alert_red.svg

Lines changed: 3 additions & 3 deletions
Loading

0 commit comments

Comments
 (0)