mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
- Changed the way progress bars are rendered
This commit is contained in:
parent
bee1dbeea4
commit
a9692dbe60
4 changed files with 5 additions and 24 deletions
|
@ -79,7 +79,6 @@ class DLListDelegate: public QItemDelegate {
|
|||
}
|
||||
case PROGRESS:{
|
||||
QStyleOptionProgressBarV2 newopt;
|
||||
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
|
||||
float progress;
|
||||
progress = index.data().toDouble()*100.;
|
||||
snprintf(tmp, MAX_CHAR_TMP, "%.1f", progress);
|
||||
|
@ -89,15 +88,9 @@ class DLListDelegate: public QItemDelegate {
|
|||
newopt.maximum = 100;
|
||||
newopt.minimum = 0;
|
||||
newopt.state |= QStyle::State_Enabled;
|
||||
newopt.textVisible = false;
|
||||
newopt.textVisible = true;
|
||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
|
||||
painter);
|
||||
//We prefer to display text manually to control color/font/boldness
|
||||
if (option.state & QStyle::State_Selected){
|
||||
opt.palette.setColor(QPalette::Text, QColor("grey"));
|
||||
painter->setPen(opt.palette.color(cg, QPalette::Text));
|
||||
}
|
||||
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue