diff options
author | Chris Xiong <chirs241097@gmail.com> | 2022-09-20 00:38:16 -0400 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2022-09-20 00:38:16 -0400 |
commit | eb39ef9d1223bb852c356cd624af836a2f62604b (patch) | |
tree | 02aeb717faf909f3f38edbdccf987ed464400091 /qdeduper | |
parent | 683c66d81898e1d7d4cb814a5740169529c3313e (diff) | |
download | deduper-eb39ef9d1223bb852c356cd624af836a2f62604b.tar.xz |
Tweak the progress dialog. Limit the width and elide text if necessary.
Diffstat (limited to 'qdeduper')
-rw-r--r-- | qdeduper/mingui.cpp | 15 |
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); |