diff --git a/clients/ozone/oxygenclient.cpp b/clients/ozone/oxygenclient.cpp index 258d15f8c1..cce52c577c 100644 --- a/clients/ozone/oxygenclient.cpp +++ b/clients/ozone/oxygenclient.cpp @@ -364,12 +364,12 @@ void OxygenClient::paintEvent(QPaintEvent *e) if (align & Qt::AlignLeft) { int left = titleLeft + QFontMetrics(options()->font(isActive(), false)).width(caption()); int right = titleLeft + titleWidth; - drawScratch(&painter, palette, left, right); + drawScratch(&painter, palette, left, right, titleTop+6); } if (align & Qt::AlignRight) { int left = titleLeft; int right = titleLeft + titleWidth - QFontMetrics(options()->font(isActive(), false)).width(caption()); - drawScratch(&painter, palette, right, left); + drawScratch(&painter, palette, right, left, titleTop+6); } if (align & Qt::AlignHCenter) { int textWidth = QFontMetrics(options()->font(isActive(), false)).width(caption()); @@ -377,8 +377,8 @@ void OxygenClient::paintEvent(QPaintEvent *e) int centerLeft = titleLeft + titleWidth/2 - textWidth/2; int centerRight = titleLeft + titleWidth/2 + textWidth/2; int right = titleLeft + titleWidth; - drawScratch(&painter, palette, centerLeft, left); - drawScratch(&painter, palette, centerRight, right); + drawScratch(&painter, palette, centerLeft, left, titleTop+6); + drawScratch(&painter, palette, centerRight, right, titleTop+6); } } @@ -408,7 +408,7 @@ void OxygenClient::paintEvent(QPaintEvent *e) renderDot(&painter, QPointF(6.5, 2.5), 1.8); } -void OxygenClient::drawScratch(QPainter *p, QPalette &palette, int start, int end) +void OxygenClient::drawScratch(QPainter *p, QPalette &palette, const int start, const int end, const int topMargin) { QLinearGradient scratchlg(QPoint(start,0), QPoint(end,0)); scratchlg.setColorAt(0.0, Qt::transparent); @@ -427,9 +427,9 @@ void OxygenClient::drawScratch(QPainter *p, QPalette &palette, int start, int en for (int i = 0; i < 3; ++i) { p->setPen(pen1); - p->drawLine(QPointF(start, 9+4*i), QPointF(end, 9+4*i)); + p->drawLine(QPointF(start, topMargin+4*i), QPointF(end, topMargin+4*i)); p->setPen(pen2); - p->drawLine(QPointF(start, 9+4*i+1), QPointF(end, 9+4*i+1)); + p->drawLine(QPointF(start, topMargin+4*i+1), QPointF(end, topMargin+4*i+1)); } p->setRenderHint(QPainter::Antialiasing, antialiasing); } diff --git a/clients/ozone/oxygenclient.h b/clients/ozone/oxygenclient.h index c55b382134..916c8548db 100644 --- a/clients/ozone/oxygenclient.h +++ b/clients/ozone/oxygenclient.h @@ -55,7 +55,7 @@ public: private: void paintEvent(QPaintEvent *e); - void drawScratch(QPainter *p, QPalette &palette, int start, int end); + void drawScratch(QPainter *p, QPalette &palette, const int start, const int end, const int topMargin); QColor titlebarTextColor(const QPalette &palette); bool colorCacheInvalid_; QColor cachedTitlebarTextColor_;