Use a progressbar instead of icon label for the status

This commit is contained in:
defnax 2021-02-07 21:33:52 +01:00
parent 0068e69ad7
commit a1f8d7caaf
2 changed files with 36 additions and 24 deletions

View File

@ -875,32 +875,28 @@ void ConnectProgressDialog::setStatusMessage(uint32_t status, const QString &tit
{ {
case MESSAGE_STATUS_INPROGRESS: case MESSAGE_STATUS_INPROGRESS:
{ {
QPixmap pm(":/images/graph-blue.png"); ui->statusprogressBar->setStyleSheet("QProgressBar::chunk {background: #ffca18; }");
ui->statusIcon->setPixmap(pm.scaledToWidth(40));
} }
break; break;
case MESSAGE_STATUS_SUCCESS: case MESSAGE_STATUS_SUCCESS:
{ {
QPixmap pm(":/images/graph-downloaded.png"); ui->statusprogressBar->setStyleSheet("QProgressBar::chunk {background: #0ed145; }");
ui->statusIcon->setPixmap(pm.scaledToWidth(40));
} }
break; break;
case MESSAGE_STATUS_CONFIG_ERROR: case MESSAGE_STATUS_CONFIG_ERROR:
{ {
QPixmap pm(":/images/graph-downloading.png"); ui->statusprogressBar->setStyleSheet("QProgressBar::chunk {background: #800000; }");
ui->statusIcon->setPixmap(pm.scaledToWidth(40));
} }
break; break;
case MESSAGE_STATUS_PEER_ERROR: case MESSAGE_STATUS_PEER_ERROR:
{ {
QPixmap pm(":/images/graph-checking.png"); ui->statusprogressBar->setStyleSheet("QProgressBar::chunk {background: #c3c3c3; }");
ui->statusIcon->setPixmap(pm.scaledToWidth(40)); ui->statusprogressBar->setValue(0);
} }
break; break;
case MESSAGE_STATUS_UNKNOWN_ERROR: case MESSAGE_STATUS_UNKNOWN_ERROR:
{ {
QPixmap pm(":/images/graph-checking.png"); ui->statusprogressBar->setStyleSheet("QProgressBar::chunk {background: #ffca18; }");
ui->statusIcon->setPixmap(pm.scaledToWidth(40));
} }
break; break;
} }

View File

@ -251,20 +251,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0">
<widget class="QLabel" name="statusIcon">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="statusTitle">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="1"> <item row="3" column="1">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
@ -281,6 +267,36 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="8" column="2">
<widget class="QLabel" name="statusTitle">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QProgressBar" name="statusprogressBar">
<property name="value">
<number>100</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="statusLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Status</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>