Skip to content

Commit db994e9

Browse files
committed
[GUI] Intro dialog new style finished.
1 parent 0b84005 commit db994e9

File tree

4 files changed

+109
-65
lines changed

4 files changed

+109
-65
lines changed

src/qt/forms/intro.ui

Lines changed: 81 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,13 @@
287287
</property>
288288
<property name="minimumSize">
289289
<size>
290-
<width>30</width>
290+
<width>50</width>
291291
<height>40</height>
292292
</size>
293293
</property>
294294
<property name="maximumSize">
295295
<size>
296-
<width>40</width>
296+
<width>50</width>
297297
<height>16777215</height>
298298
</size>
299299
</property>
@@ -391,13 +391,85 @@
391391
</spacer>
392392
</item>
393393
<item>
394-
<widget class="QDialogButtonBox" name="buttonBox">
395-
<property name="orientation">
396-
<enum>Qt::Horizontal</enum>
397-
</property>
398-
<property name="standardButtons">
399-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
394+
<widget class="QWidget" name="widget" native="true">
395+
<property name="minimumSize">
396+
<size>
397+
<width>0</width>
398+
<height>50</height>
399+
</size>
400400
</property>
401+
<layout class="QHBoxLayout" name="horizontalLayout_3">
402+
<property name="spacing">
403+
<number>0</number>
404+
</property>
405+
<property name="leftMargin">
406+
<number>0</number>
407+
</property>
408+
<property name="topMargin">
409+
<number>0</number>
410+
</property>
411+
<property name="rightMargin">
412+
<number>0</number>
413+
</property>
414+
<property name="bottomMargin">
415+
<number>0</number>
416+
</property>
417+
<item>
418+
<spacer name="horizontalSpacer">
419+
<property name="orientation">
420+
<enum>Qt::Horizontal</enum>
421+
</property>
422+
<property name="sizeHint" stdset="0">
423+
<size>
424+
<width>535</width>
425+
<height>20</height>
426+
</size>
427+
</property>
428+
</spacer>
429+
</item>
430+
<item>
431+
<widget class="QPushButton" name="pushButtonCancel">
432+
<property name="minimumSize">
433+
<size>
434+
<width>100</width>
435+
<height>40</height>
436+
</size>
437+
</property>
438+
<property name="text">
439+
<string>CANCEL</string>
440+
</property>
441+
</widget>
442+
</item>
443+
<item>
444+
<spacer name="horizontalSpacer_2">
445+
<property name="orientation">
446+
<enum>Qt::Horizontal</enum>
447+
</property>
448+
<property name="sizeType">
449+
<enum>QSizePolicy::Fixed</enum>
450+
</property>
451+
<property name="sizeHint" stdset="0">
452+
<size>
453+
<width>20</width>
454+
<height>20</height>
455+
</size>
456+
</property>
457+
</spacer>
458+
</item>
459+
<item>
460+
<widget class="QPushButton" name="pushButtonOk">
461+
<property name="minimumSize">
462+
<size>
463+
<width>100</width>
464+
<height>40</height>
465+
</size>
466+
</property>
467+
<property name="text">
468+
<string>OK</string>
469+
</property>
470+
</widget>
471+
</item>
472+
</layout>
401473
</widget>
402474
</item>
403475
</layout>
@@ -412,38 +484,5 @@
412484
</layout>
413485
</widget>
414486
<resources/>
415-
<connections>
416-
<connection>
417-
<sender>buttonBox</sender>
418-
<signal>accepted()</signal>
419-
<receiver>Intro</receiver>
420-
<slot>accept()</slot>
421-
<hints>
422-
<hint type="sourcelabel">
423-
<x>20</x>
424-
<y>20</y>
425-
</hint>
426-
<hint type="destinationlabel">
427-
<x>20</x>
428-
<y>20</y>
429-
</hint>
430-
</hints>
431-
</connection>
432-
<connection>
433-
<sender>buttonBox</sender>
434-
<signal>rejected()</signal>
435-
<receiver>Intro</receiver>
436-
<slot>reject()</slot>
437-
<hints>
438-
<hint type="sourcelabel">
439-
<x>20</x>
440-
<y>20</y>
441-
</hint>
442-
<hint type="destinationlabel">
443-
<x>20</x>
444-
<y>20</y>
445-
</hint>
446-
</hints>
447-
</connection>
448-
</connections>
487+
<connections/>
449488
</ui>

src/qt/intro.cpp

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "guiutil.h"
1111

1212
#include "util.h"
13+
#include "qt/pivx/qtutils.h"
1314

1415
#include <boost/filesystem.hpp>
1516

@@ -109,27 +110,25 @@ Intro::Intro(QWidget* parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::W
109110
signalled(false)
110111
{
111112
ui->setupUi(this);
112-
113113
this->setStyleSheet(GUIUtil::loadStyleSheet());
114114

115-
ui->frame->setProperty("cssClass", "container-welcome-step2");
116-
ui->container->setProperty("cssClass", "container-welcome-stack");
117-
ui->frame_2->setProperty("cssClass", "container-welcome");
118-
119-
ui->label_2->setProperty("cssClass", "text-title-welcome");
120-
121-
ui->dataDirDefault->setProperty("cssClass", "radio-welcome");
122-
123-
ui->dataDirCustom->setProperty("cssClass", "radio-welcome");
115+
setCssProperty(ui->frame, "container-welcome-step2");
116+
setCssProperty(ui->container, "container-welcome-stack");
117+
setCssProperty(ui->frame_2, "container-welcome");
118+
setCssProperty(ui->label_2, "text-title-welcome");
119+
setCssProperty(ui->label_4, "text-intro-white");
120+
setCssProperty(ui->sizeWarningLabel, "text-intro-white");
121+
setCssProperty(ui->freeSpace, "text-intro-white");
124122

125-
126-
127-
ui->dataDirectory->setProperty("cssClass", "edit-primary-welcome");
123+
setCssProperty({ui->dataDirDefault, ui->dataDirCustom}, "radio-welcome");
124+
setCssProperty(ui->dataDirectory, "edit-primary-welcome");
128125
ui->dataDirectory->setAttribute(Qt::WA_MacShowFocusRect, 0);
126+
setCssProperty(ui->ellipsisButton, "btn-dots-welcome");
127+
setCssBtnPrimary(ui->pushButtonOk);
128+
setCssBtnSecondary(ui->pushButtonCancel);
129129

130-
131-
ui->ellipsisButton->setProperty("cssClass", "btn-dots-welcome");
132-
130+
connect(ui->pushButtonOk, SIGNAL(clicked()), this, SLOT(accept()));
131+
connect(ui->pushButtonCancel, SIGNAL(clicked()), this, SLOT(close()));
133132

134133
ui->sizeWarningLabel->setText(ui->sizeWarningLabel->text().arg(BLOCK_CHAIN_SIZE / GB_BYTES));
135134
startThread();
@@ -242,13 +241,13 @@ void Intro::setStatus(int status, const QString& message, quint64 bytesAvailable
242241
ui->freeSpace->setText(freeString + ".");
243242
}
244243
/* Don't allow confirm in ERROR state */
245-
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(status != FreespaceChecker::ST_ERROR);
244+
ui->pushButtonOk->setEnabled(status != FreespaceChecker::ST_ERROR);
246245
}
247246

248247
void Intro::on_dataDirectory_textChanged(const QString& dataDirStr)
249248
{
250249
/* Disable OK button until check result comes in */
251-
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
250+
ui->pushButtonOk->setEnabled(false);
252251
checkPath(dataDirStr);
253252
}
254253

@@ -272,11 +271,6 @@ void Intro::on_dataDirCustom_clicked()
272271

273272
void Intro::startThread()
274273
{
275-
276-
277-
278-
279-
280274
thread = new QThread(this);
281275
FreespaceChecker* executor = new FreespaceChecker(this);
282276
executor->moveToThread(thread);

src/qt/pivx/res/css/style_dark.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,6 +2975,12 @@ HH INTRO
29752975
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
29762976
*/
29772977

2978+
*[cssClass="text-intro-white"] {
2979+
color:#FFFFFF;
2980+
font-size:16px;
2981+
}
2982+
2983+
29782984
QPushButton[cssClass="btn-dots-welcome"] {
29792985
border: 1px solid #b088ff;
29802986
background-color:#b088ff;

src/qt/pivx/res/css/style_light.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2961,6 +2961,11 @@ HH INTRO
29612961
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
29622962
*/
29632963

2964+
*[cssClass="text-intro-white"] {
2965+
color:#FFFFFF;
2966+
font-size:16px;
2967+
}
2968+
29642969
QPushButton[cssClass="btn-dots-welcome"] {
29652970
border: 1px solid #b088ff;
29662971
background-color:#b088ff;

0 commit comments

Comments
 (0)