- Handling progress bar text painting ourselves because some styles really don't handle it well (cleanlooks...)

This commit is contained in:
Christophe Dumez 2007-08-21 17:33:06 +00:00
parent d8dd509a7b
commit 6ee9152b21
5 changed files with 15 additions and 9 deletions

View file

@ -88,9 +88,11 @@ class DLListDelegate: public QItemDelegate {
newopt.maximum = 100;
newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true;
newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
painter);
painter->setPen(QColor("Black"));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break;
}
default:

View file

@ -81,9 +81,11 @@ class FinishedListDelegate: public QItemDelegate {
newopt.maximum = 100;
newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true;
newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
painter);
painter->setPen(QColor("Black"));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break;
}
default:

View file

@ -158,7 +158,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent) {
force_exit = false;
// Resume unfinished torrents
BTSession->resumeUnfinishedTorrents();
// Load last columns width for download list
// Load last columns width for download list
if(!loadColWidthDLList()) {
downloadList->header()->resizeSection(0, 200);
}

View file

@ -63,9 +63,10 @@ class PreviewListDelegate: public QItemDelegate {
newopt.maximum = 100;
newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
painter);
newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
painter->setPen(QColor("Black"));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break;
}
default:

View file

@ -76,9 +76,10 @@ class PropListDelegate: public QItemDelegate {
newopt.maximum = 100;
newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
painter);
newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
painter->setPen(QColor("Black"));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break;
}
case PRIORITY:{