TODO this can be made a lot prettier
| 92 | |
| 93 | // TODO this can be made a lot prettier |
| 94 | void drawProgressOverlay(QPainter *painter, const QStyleOptionViewItem &option, |
| 95 | const int value, const int maximum) |
| 96 | { |
| 97 | if (maximum == 0 || value == maximum) |
| 98 | { |
| 99 | return; |
| 100 | } |
| 101 | |
| 102 | painter->save(); |
| 103 | |
| 104 | qreal percent = (qreal)value / (qreal)maximum; |
| 105 | QColor color = option.palette.color(QPalette::Dark); |
| 106 | color.setAlphaF(0.70f); |
| 107 | painter->setBrush(color); |
| 108 | painter->setPen(QPen(QBrush(), 0)); |
| 109 | painter->drawPie(option.rect, 90 * 16, -percent * 360 * 16); |
| 110 | |
| 111 | painter->restore(); |
| 112 | } |
| 113 | |
| 114 | void drawBadges(QPainter *painter, const QStyleOptionViewItem &option, BaseInstance *instance, QIcon::Mode mode, QIcon::State state) |
| 115 | { |