mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 09:13:08 -07:00
- Handling progress bar text painting ourselves because some styles really don't handle it well (cleanlooks...)
This commit is contained in:
parent
d8dd509a7b
commit
6ee9152b21
5 changed files with 15 additions and 9 deletions
|
@ -88,9 +88,11 @@ class DLListDelegate: public QItemDelegate {
|
||||||
newopt.maximum = 100;
|
newopt.maximum = 100;
|
||||||
newopt.minimum = 0;
|
newopt.minimum = 0;
|
||||||
newopt.state |= QStyle::State_Enabled;
|
newopt.state |= QStyle::State_Enabled;
|
||||||
newopt.textVisible = true;
|
newopt.textVisible = false;
|
||||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
|
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
|
||||||
painter);
|
painter);
|
||||||
|
painter->setPen(QColor("Black"));
|
||||||
|
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -81,9 +81,11 @@ class FinishedListDelegate: public QItemDelegate {
|
||||||
newopt.maximum = 100;
|
newopt.maximum = 100;
|
||||||
newopt.minimum = 0;
|
newopt.minimum = 0;
|
||||||
newopt.state |= QStyle::State_Enabled;
|
newopt.state |= QStyle::State_Enabled;
|
||||||
newopt.textVisible = true;
|
newopt.textVisible = false;
|
||||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
|
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
|
||||||
painter);
|
painter);
|
||||||
|
painter->setPen(QColor("Black"));
|
||||||
|
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -63,9 +63,10 @@ class PreviewListDelegate: public QItemDelegate {
|
||||||
newopt.maximum = 100;
|
newopt.maximum = 100;
|
||||||
newopt.minimum = 0;
|
newopt.minimum = 0;
|
||||||
newopt.state |= QStyle::State_Enabled;
|
newopt.state |= QStyle::State_Enabled;
|
||||||
newopt.textVisible = true;
|
newopt.textVisible = false;
|
||||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
|
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
|
||||||
painter);
|
painter->setPen(QColor("Black"));
|
||||||
|
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -76,9 +76,10 @@ class PropListDelegate: public QItemDelegate {
|
||||||
newopt.maximum = 100;
|
newopt.maximum = 100;
|
||||||
newopt.minimum = 0;
|
newopt.minimum = 0;
|
||||||
newopt.state |= QStyle::State_Enabled;
|
newopt.state |= QStyle::State_Enabled;
|
||||||
newopt.textVisible = true;
|
newopt.textVisible = false;
|
||||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
|
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
|
||||||
painter);
|
painter->setPen(QColor("Black"));
|
||||||
|
painter->drawText(opt.rect, Qt::AlignCenter, newopt.text);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PRIORITY:{
|
case PRIORITY:{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue