summaryrefslogtreecommitdiffstats
path: root/progressdialog.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2016-12-06 11:18:07 +0100
committerArno <arno@disconnect.de>2016-12-06 11:18:07 +0100
commit0e02ad100b0e96c77b6030853bd88a6d4706a776 (patch)
treec5fe9bf96cb848795e5c760b8b775ed81070ed9b /progressdialog.cpp
parent0432c09d7889009beb9557e0546d0c4f240bb37e (diff)
downloadShemovCleaner-0e02ad100b0e96c77b6030853bd88a6d4706a776.tar.gz
ShemovCleaner-0e02ad100b0e96c77b6030853bd88a6d4706a776.tar.bz2
ShemovCleaner-0e02ad100b0e96c77b6030853bd88a6d4706a776.zip
Prettify ProgressDialog
Make it fixed width, show only the filename from the source instead of the full path and elide text if necessary.
Diffstat (limited to 'progressdialog.cpp')
-rw-r--r--progressdialog.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/progressdialog.cpp b/progressdialog.cpp
index 778a3b4..f354a07 100644
--- a/progressdialog.cpp
+++ b/progressdialog.cpp
@@ -17,9 +17,18 @@ ProgressDialog::ProgressDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(par
mainLayout->addWidget(mLabel);
mainLayout->addWidget(mProgress);
mainLayout->addLayout(btnLayout);
+ setMaximumWidth(400);
+ setMinimumWidth(400);
setLayout(mainLayout);
}
+void ProgressDialog::setLabelText(const QString &text){
+ QFontMetrics fm(mLabel->font());
+ int width = mLabel->width() - 4;
+ QString fixed = fm.elidedText(text, Qt::ElideRight, width);
+ mLabel->setText(fixed);
+}
+
void ProgressDialog::setValue(int val){
mProgress->setValue(val);
}