diff --git a/src/widgets/common/downloaditem.cpp b/src/widgets/common/downloaditem.cpp index 4c1e179..2161690 100644 --- a/src/widgets/common/downloaditem.cpp +++ b/src/widgets/common/downloaditem.cpp @@ -24,6 +24,7 @@ DownloadItem::DownloadItem(QWidget *parent) : QWidget(parent), ui->widget_spinner->hide(); ui->label->setElideMode(Qt::TextElideMode::ElideRight); + ui->label_2->setElideMode(Qt::TextElideMode::ElideRight); } DownloadItem::~DownloadItem() @@ -35,10 +36,12 @@ void DownloadItem::setValue(qint64 value) { ui->progressBar->setValue(qint32(value)); 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%") { download = 1; 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(); qDebug() << "/tmp/spark-store/" + ui->label_filename->text().toUtf8(); ui->label_2->setText(tr("Installing")); + ui->label_2->setToolTip(tr("Installing")); QtConcurrent::run([=]() { @@ -143,6 +147,7 @@ void DownloadItem::install(int t) ui->pushButton_install->hide(); Utils::sendNotification("spark-store",tr("Spark Store"),ui->label->text() + " " + tr("Installation complete.")); ui->label_2->setText(tr("Finish")); + ui->label_2->setToolTip(tr("Finish")); download = 3; ui->pushButton_3->show(); } @@ -153,6 +158,7 @@ void DownloadItem::install(int t) download = 1; 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->setToolTip(tr("Error happened in dpkg progress , you can try it again")); 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.")); 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_3->hide(); } @@ -180,6 +187,7 @@ void DownloadItem::on_pushButton_install_clicked() void DownloadItem::on_pushButton_2_clicked() { ui->label_2->setText(tr("Download canceled")); + ui->label_2->setToolTip(tr("Download canceled")); download = 2; ui->pushButton_2->setEnabled(false); ui->progressBar->hide(); diff --git a/src/widgets/common/downloaditem.ui b/src/widgets/common/downloaditem.ui index a02e136..476f609 100644 --- a/src/widgets/common/downloaditem.ui +++ b/src/widgets/common/downloaditem.ui @@ -100,14 +100,14 @@ - + 0 0 - 80 + 120 48 @@ -216,7 +216,7 @@ - + 9