|
|
|
@@ -2454,6 +2454,7 @@ class CanvasBox(QGraphicsItem): |
|
|
|
|
|
|
|
def paint(self, painter, option, widget): |
|
|
|
painter.save() |
|
|
|
line_width = canvas.theme.box_pen.widthF() |
|
|
|
|
|
|
|
# Draw rectangle |
|
|
|
if self.isSelected(): |
|
|
|
@@ -2469,22 +2470,22 @@ class CanvasBox(QGraphicsItem): |
|
|
|
else: |
|
|
|
painter.setBrush(canvas.theme.box_bg_1) |
|
|
|
|
|
|
|
painter.drawRoundedRect(QRectF(0.5, 0.5, self.p_width-1, self.p_height-1), canvas.theme.box_rounding, canvas.theme.box_rounding) |
|
|
|
painter.drawRoundedRect(QRectF(line_width/2, line_width/2, self.p_width-line_width, self.p_height-line_width), canvas.theme.box_rounding, canvas.theme.box_rounding) |
|
|
|
|
|
|
|
# Draw pixmap header |
|
|
|
if canvas.theme.box_header_pixmap: |
|
|
|
painter.setPen(Qt.NoPen) |
|
|
|
painter.setBrush(canvas.theme.box_bg_2) |
|
|
|
painter.drawRoundedRect(QRectF(1, 1, self.p_width-2, canvas.theme.box_header_height), canvas.theme.box_rounding-0.5, canvas.theme.box_rounding-0.5) |
|
|
|
painter.drawRoundedRect(QRectF(line_width, line_width, self.p_width-line_width*2, canvas.theme.box_header_height), canvas.theme.box_rounding-0.5, canvas.theme.box_rounding-0.5) |
|
|
|
|
|
|
|
# Including pixmap clip path |
|
|
|
clipPath = QPainterPath() |
|
|
|
clipPath.addRoundedRect(QRectF(1+1, 1+1, self.p_width-2-2, canvas.theme.box_header_height-2), canvas.theme.box_rounding-1.5, canvas.theme.box_rounding-1.5) |
|
|
|
clipPath.addRoundedRect(QRectF(line_width+1, line_width+1, self.p_width-2-line_width*2, canvas.theme.box_header_height-2), canvas.theme.box_rounding-1.5, canvas.theme.box_rounding-1.5) |
|
|
|
painter.setClipPath(clipPath) |
|
|
|
painter.setClipping(True) |
|
|
|
|
|
|
|
headerPos = QPointF(1, 1) |
|
|
|
headerRect = QRectF(2, 2, self.p_width-4, canvas.theme.box_header_height-3) |
|
|
|
headerRect = QRectF(line_width+1, line_width+1, self.p_width-2-line_width*2, canvas.theme.box_header_height-2-line_width) |
|
|
|
painter.drawTiledPixmap(headerRect, canvas.theme.box_header_pixmap, headerPos) |
|
|
|
|
|
|
|
painter.setClipping(False) |
|
|
|
|