+ const QRectF r = label_rect(rect).adjusted(
+ LineThickness / 2, LineThickness / 2,
+ -LineThickness / 2, -LineThickness / 2);
+
+ // Paint the label
+ const QPointF points[] = {
+ r.topRight(),
+ r.topLeft(),
+ r.bottomLeft(),
+ r.bottomRight()
+ };
+
+ if (selected()) {
+ const QPen pen(highlight_pen());
+ p.setPen(QPen(pen.brush(), pen.width() + LineThickness,
+ Qt::SolidLine, Qt::SquareCap, Qt::RoundJoin));
+ p.setBrush(Qt::transparent);
+ p.drawPolyline(points, countof(points));
+ }
+
+ p.setPen(QPen(QBrush(LineColour.darker()), LineThickness,
+ Qt::SolidLine, Qt::SquareCap, Qt::RoundJoin));
+ p.drawPolyline(points, countof(points));
+ p.setPen(QPen(QBrush(hover ? LineColour.lighter() : LineColour),
+ LineThickness - 2, Qt::SolidLine, Qt::SquareCap,
+ Qt::RoundJoin));
+ p.drawPolyline(points, countof(points));