mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-27 06:54:20 +00:00
Always draw background
This commit is contained in:
parent
2b2b3a4fe7
commit
a16c557137
@ -72,14 +72,13 @@ void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
|||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
QStyleOptionViewItem opt = QItemDelegate::setOptions(index, option);
|
QStyleOptionViewItem opt = QItemDelegate::setOptions(index, option);
|
||||||
|
QItemDelegate::drawBackground(painter, opt, index);
|
||||||
|
|
||||||
switch(index.column()) {
|
switch(index.column()) {
|
||||||
case PCSIZE:
|
case PCSIZE:
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, Utils::Misc::friendlyUnit(index.data().toLongLong()));
|
QItemDelegate::drawDisplay(painter, opt, option.rect, Utils::Misc::friendlyUnit(index.data().toLongLong()));
|
||||||
break;
|
break;
|
||||||
case REMAINING:
|
case REMAINING:
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, Utils::Misc::friendlyUnit(index.data().toLongLong()));
|
QItemDelegate::drawDisplay(painter, opt, option.rect, Utils::Misc::friendlyUnit(index.data().toLongLong()));
|
||||||
break;
|
break;
|
||||||
case PROGRESS:
|
case PROGRESS:
|
||||||
@ -106,13 +105,8 @@ void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
|||||||
st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0);
|
st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// Do not display anything if the file is disabled (progress == 0)
|
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case PRIORITY: {
|
case PRIORITY: {
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
QString text = "";
|
QString text = "";
|
||||||
switch (index.data().toInt()) {
|
switch (index.data().toInt()) {
|
||||||
case prio::MIXED:
|
case prio::MIXED:
|
||||||
|
@ -47,19 +47,15 @@ void SearchListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
|||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
QStyleOptionViewItem opt = QItemDelegate::setOptions(index, option);
|
QStyleOptionViewItem opt = QItemDelegate::setOptions(index, option);
|
||||||
|
QItemDelegate::drawBackground(painter, opt, index);
|
||||||
|
|
||||||
switch(index.column()) {
|
switch(index.column()) {
|
||||||
case SearchSortModel::SIZE:
|
case SearchSortModel::SIZE:
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
|
opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, Utils::Misc::friendlyUnit(index.data().toLongLong()));
|
QItemDelegate::drawDisplay(painter, opt, option.rect, Utils::Misc::friendlyUnit(index.data().toLongLong()));
|
||||||
break;
|
break;
|
||||||
case SearchSortModel::SEEDS:
|
case SearchSortModel::SEEDS:
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
|
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, (index.data().toLongLong() >= 0) ? index.data().toString() : tr("Unknown"));
|
|
||||||
break;
|
|
||||||
case SearchSortModel::LEECHES:
|
case SearchSortModel::LEECHES:
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
|
||||||
opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
|
opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, (index.data().toLongLong() >= 0) ? index.data().toString() : tr("Unknown"));
|
QItemDelegate::drawDisplay(painter, opt, option.rect, (index.data().toLongLong() >= 0) ? index.data().toString() : tr("Unknown"));
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user