mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-10-28 04:52:19 +08:00
fix: 修复下载列表中进度提示文字显示不完整的问题
QLabel 未处理文字过长的问题 Log: 控件提升为 DLabel,设置文字过长时右侧显示省略号;添加鼠标悬浮提示;固定 item 中应用名称宽度未 120px,保证进度条显示位置对齐
This commit is contained in:
parent
116f14845e
commit
8b2a61e4b2
@ -24,6 +24,7 @@ DownloadItem::DownloadItem(QWidget *parent) : QWidget(parent),
|
|||||||
ui->widget_spinner->hide();
|
ui->widget_spinner->hide();
|
||||||
|
|
||||||
ui->label->setElideMode(Qt::TextElideMode::ElideRight);
|
ui->label->setElideMode(Qt::TextElideMode::ElideRight);
|
||||||
|
ui->label_2->setElideMode(Qt::TextElideMode::ElideRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
DownloadItem::~DownloadItem()
|
DownloadItem::~DownloadItem()
|
||||||
@ -35,10 +36,12 @@ void DownloadItem::setValue(qint64 value)
|
|||||||
{
|
{
|
||||||
ui->progressBar->setValue(qint32(value));
|
ui->progressBar->setValue(qint32(value));
|
||||||
ui->label_2->setText(QString::number(double(value) / 100) + "% (" + speed + ")");
|
ui->label_2->setText(QString::number(double(value) / 100) + "% (" + speed + ")");
|
||||||
|
ui->label_2->setToolTip(QString::number(double(value) / 100) + "% (" + speed + ")");
|
||||||
if (ui->label_2->text().left(4) == "100%")
|
if (ui->label_2->text().left(4) == "100%")
|
||||||
{
|
{
|
||||||
download = 1;
|
download = 1;
|
||||||
ui->label_2->setText(tr("Download Complete."));
|
ui->label_2->setText(tr("Download Complete."));
|
||||||
|
ui->label_2->setToolTip(tr("Download Complete."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,6 +102,7 @@ void DownloadItem::install(int t)
|
|||||||
ui->widget_spinner->show();
|
ui->widget_spinner->show();
|
||||||
qDebug() << "/tmp/spark-store/" + ui->label_filename->text().toUtf8();
|
qDebug() << "/tmp/spark-store/" + ui->label_filename->text().toUtf8();
|
||||||
ui->label_2->setText(tr("Installing"));
|
ui->label_2->setText(tr("Installing"));
|
||||||
|
ui->label_2->setToolTip(tr("Installing"));
|
||||||
|
|
||||||
QtConcurrent::run([=]()
|
QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
@ -143,6 +147,7 @@ void DownloadItem::install(int t)
|
|||||||
ui->pushButton_install->hide();
|
ui->pushButton_install->hide();
|
||||||
Utils::sendNotification("spark-store",tr("Spark Store"),ui->label->text() + " " + tr("Installation complete."));
|
Utils::sendNotification("spark-store",tr("Spark Store"),ui->label->text() + " " + tr("Installation complete."));
|
||||||
ui->label_2->setText(tr("Finish"));
|
ui->label_2->setText(tr("Finish"));
|
||||||
|
ui->label_2->setToolTip(tr("Finish"));
|
||||||
download = 3;
|
download = 3;
|
||||||
ui->pushButton_3->show();
|
ui->pushButton_3->show();
|
||||||
}
|
}
|
||||||
@ -153,6 +158,7 @@ void DownloadItem::install(int t)
|
|||||||
download = 1;
|
download = 1;
|
||||||
Utils::sendNotification("spark-store",tr("Spark Store"),tr("Error happened in dpkg progress , you can try it again."));
|
Utils::sendNotification("spark-store",tr("Spark Store"),tr("Error happened in dpkg progress , you can try it again."));
|
||||||
ui->label_2->setText(tr("Error happened in dpkg progress , you can try it again"));
|
ui->label_2->setText(tr("Error happened in dpkg progress , you can try it again"));
|
||||||
|
ui->label_2->setToolTip(tr("Error happened in dpkg progress , you can try it again"));
|
||||||
ui->pushButton_3->show();
|
ui->pushButton_3->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,6 +166,7 @@ void DownloadItem::install(int t)
|
|||||||
{
|
{
|
||||||
Utils::sendNotification("spark-store",tr("Spark Store"),tr("dpkg progress had been aborted,you can retry installation."));
|
Utils::sendNotification("spark-store",tr("Spark Store"),tr("dpkg progress had been aborted,you can retry installation."));
|
||||||
ui->label_2->setText(tr("dpkg progress had been aborted,you can retry installation"));
|
ui->label_2->setText(tr("dpkg progress had been aborted,you can retry installation"));
|
||||||
|
ui->label_2->setToolTip(tr("dpkg progress had been aborted,you can retry installation"));
|
||||||
ui->pushButton_install->show();
|
ui->pushButton_install->show();
|
||||||
ui->pushButton_3->hide();
|
ui->pushButton_3->hide();
|
||||||
}
|
}
|
||||||
@ -180,6 +187,7 @@ void DownloadItem::on_pushButton_install_clicked()
|
|||||||
void DownloadItem::on_pushButton_2_clicked()
|
void DownloadItem::on_pushButton_2_clicked()
|
||||||
{
|
{
|
||||||
ui->label_2->setText(tr("Download canceled"));
|
ui->label_2->setText(tr("Download canceled"));
|
||||||
|
ui->label_2->setToolTip(tr("Download canceled"));
|
||||||
download = 2;
|
download = 2;
|
||||||
ui->pushButton_2->setEnabled(false);
|
ui->pushButton_2->setEnabled(false);
|
||||||
ui->progressBar->hide();
|
ui->progressBar->hide();
|
||||||
|
|||||||
@ -100,14 +100,14 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="DLabel" name="label">
|
<widget class="DLabel" name="label">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>80</width>
|
<width>120</width>
|
||||||
<height>48</height>
|
<height>48</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -216,7 +216,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="DLabel" name="label_2">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>9</pointsize>
|
<pointsize>9</pointsize>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user