aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-20 00:38:16 -0400
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-20 00:38:16 -0400
commiteb39ef9d1223bb852c356cd624af836a2f62604b (patch)
tree02aeb717faf909f3f38edbdccf987ed464400091
parent683c66d81898e1d7d4cb814a5740169529c3313e (diff)
downloaddeduper-eb39ef9d1223bb852c356cd624af836a2f62604b.tar.xz
Tweak the progress dialog. Limit the width and elide text if necessary.
-rw-r--r--qdeduper/mingui.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/qdeduper/mingui.cpp b/qdeduper/mingui.cpp
index 4e4cc87..06b380c 100644
--- a/qdeduper/mingui.cpp
+++ b/qdeduper/mingui.cpp
@@ -109,6 +109,16 @@ DeduperMainWindow::DeduperMainWindow()
pd->setMinimumDuration(0);
pd->setAutoReset(false);
pd->setAutoClose(false);
+ pd->setWindowTitle("Progress");
+ pd->setFont(this->font());
+ QLabel *pdlb = new QLabel(pd);
+ pdlb->setMaximumWidth(500);
+ pdlb->setAlignment(Qt::AlignmentFlag::AlignLeft | Qt::AlignmentFlag::AlignVCenter);
+ pd->setLabel(pdlb);
+ pd->setMinimumWidth(520);
+ pd->setMaximumWidth(520);
+ pd->setMaximumHeight(120);
+ pd->setMinimumHeight(120);
pd->close();
for (size_t i = 0; i < keys.size(); ++i)
@@ -410,7 +420,10 @@ void DeduperMainWindow::scan_dirs(std::vector<std::pair<fs::path, bool>> paths)
if (std::chrono::steady_clock::now() - lt > 100ms)
{
lt = std::chrono::steady_clock::now();
- this->pd->setLabelText(QString("Looking for files to scan: %1").arg(fsstr_to_qstring(p)));
+ QString etxt = this->fontMetrics().elidedText(QString("Looking for files to scan: %1").arg(fsstr_to_qstring(p)),
+ Qt::TextElideMode::ElideMiddle,
+ 475);
+ this->pd->setLabelText(etxt);
this->pd->setValue(c);
}
}, Qt::ConnectionType::QueuedConnection);