- COSMETIC: Progress bar text now uses style foreground color

This commit is contained in:
Christophe Dumez 2007-09-18 22:09:06 +00:00
commit 2fc7039cc7
4 changed files with 8 additions and 42 deletions

View file

@ -79,7 +79,8 @@ class FinishedListDelegate: public QItemDelegate {
newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
painter);
painter->setPen(QColor("Black"));
QPalette::ColorGroup cg = opt.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
painter->setPen(opt.palette.color(cg, QPalette::WindowText));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break;
}

View file

@ -63,7 +63,8 @@ class PreviewListDelegate: public QItemDelegate {
newopt.state |= QStyle::State_Enabled;
newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
painter->setPen(QColor("Black"));
QPalette::ColorGroup cg = opt.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
painter->setPen(opt.palette.color(cg, QPalette::WindowText));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break;
}

View file

@ -77,7 +77,8 @@ class PropListDelegate: public QItemDelegate {
newopt.state |= QStyle::State_Enabled;
newopt.textVisible = false;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
painter->setPen(QColor("Black"));
QPalette::ColorGroup cg = opt.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
painter->setPen(opt.palette.color(cg, QPalette::WindowText));
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
break;
}