Merge pull request #2298 from defnax/ui-fix-1

Use a progressbar instead of icon label for the status
This commit is contained in:
defnax 2021-02-13 22:31:37 +01:00 committed by GitHub
commit ea062ae231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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:
{
QPixmap pm(":/images/graph-blue.png");
ui->statusIcon->setPixmap(pm.scaledToWidth(40));
ui->statusprogressBar->setStyleSheet("QProgressBar::chunk {background: #ffca18; }");
}
break;
case MESSAGE_STATUS_SUCCESS:
{
QPixmap pm(":/images/graph-downloaded.png");
ui->statusIcon->setPixmap(pm.scaledToWidth(40));
ui->statusprogressBar->setStyleSheet("QProgressBar::chunk {background: #0ed145; }");
}
break;
case MESSAGE_STATUS_CONFIG_ERROR:
{
QPixmap pm(":/images/graph-downloading.png");
ui->statusIcon->setPixmap(pm.scaledToWidth(40));
ui->statusprogressBar->setStyleSheet("QProgressBar::chunk {background: #800000; }");
}
break;
case MESSAGE_STATUS_PEER_ERROR:
{
QPixmap pm(":/images/graph-checking.png");
ui->statusIcon->setPixmap(pm.scaledToWidth(40));
ui->statusprogressBar->setStyleSheet("QProgressBar::chunk {background: #c3c3c3; }");
ui->statusprogressBar->setValue(0);
}
break;
case MESSAGE_STATUS_UNKNOWN_ERROR:
{
QPixmap pm(":/images/graph-checking.png");
ui->statusIcon->setPixmap(pm.scaledToWidth(40));
ui->statusprogressBar->setStyleSheet("QProgressBar::chunk {background: #ffca18; }");
}
break;
}

View File

@ -251,20 +251,6 @@
</property>
</widget>
</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">
<spacer name="verticalSpacer">
<property name="orientation">
@ -281,6 +267,36 @@
</property>
</spacer>
</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>
</item>
</layout>