TODO this can be made a lot prettier
| 112 | |
| 113 | // TODO this can be made a lot prettier |
| 114 | void drawProgressOverlay(QPainter *painter, const QStyleOptionViewItem &option, |
| 115 | const int value, const int maximum) |
| 116 | { |
| 117 | if (maximum == 0 || value == maximum) |
| 118 | { |
| 119 | return; |
| 120 | } |
| 121 | |
| 122 | painter->save(); |
| 123 | |
| 124 | qreal percent = (qreal)value / (qreal)maximum; |
| 125 | QColor color = option.palette.color(QPalette::Dark); |
| 126 | color.setAlphaF(0.70f); |
| 127 | painter->setBrush(color); |
| 128 | painter->setPen(QPen(QBrush(), 0)); |
| 129 | painter->drawPie(option.rect, 90 * 16, -percent * 360 * 16); |
| 130 | |
| 131 | painter->restore(); |
| 132 | } |
| 133 | |
| 134 | void drawBadges(QPainter *painter, const QStyleOptionViewItem &option, BaseInstance *instance, QIcon::Mode mode, QIcon::State state) |
| 135 | { |