Skip to content

Commit 38fcc87

Browse files
committed
Add custom RDStyle rendering of view item checkmark indicators
1 parent 5619ed6 commit 38fcc87

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

qrenderdoc/Styles/RDStyle/RDStyle.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,30 @@ void RDStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *opt, Q
12531253

12541254
return;
12551255
}
1256+
else if(element == QStyle::PE_IndicatorViewItemCheck)
1257+
{
1258+
QRect rect = opt->rect;
1259+
1260+
QPen outlinePen(outlineBrush(opt->palette), 1.0);
1261+
1262+
p->save();
1263+
p->setRenderHint(QPainter::Antialiasing);
1264+
1265+
QPainterPath path;
1266+
path.addRoundedRect(rect, 1.0, 1.0);
1267+
1268+
p->setPen(outlinePen);
1269+
p->drawPath(path.translated(QPointF(0.5, 0.5)));
1270+
1271+
rect = rect.adjusted(2, 2, -1, -1);
1272+
1273+
if(opt->state & State_On)
1274+
p->fillRect(rect, opt->palette.brush(QPalette::ButtonText));
1275+
1276+
p->restore();
1277+
1278+
return;
1279+
}
12561280

12571281
RDTweakedNativeStyle::drawPrimitive(element, opt, p, widget);
12581282
}

0 commit comments

Comments
 (0)