From 104ccbb732213f3aa62fb96daec900c42df03ced Mon Sep 17 00:00:00 2001 From: Nikita Zlobin Date: Mon, 14 Aug 2017 22:36:33 +0500 Subject: [PATCH] Clip header pixmap --- src/patchcanvas.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/patchcanvas.py b/src/patchcanvas.py index eccce7f..eec8400 100644 --- a/src/patchcanvas.py +++ b/src/patchcanvas.py @@ -2478,10 +2478,18 @@ class CanvasBox(QGraphicsItem): painter.setBrush(canvas.theme.box_bg_2) painter.drawRoundedRect(QRectF(1, 1, self.p_width-2, canvas.theme.box_header_height), self.p_rounding-0.5, self.p_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), self.p_rounding-1.5, self.p_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) painter.drawTiledPixmap(headerRect, canvas.theme.box_header_pixmap, headerPos) + painter.setClipping(False) + # Draw text painter.setFont(self.m_font_name)