Sync r812950 from oxygen.
svn path=/trunk/KDE/kdebase/workspace/; revision=812982
This commit is contained in:
parent
b68e9b0f77
commit
6d097abe32
2 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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_;
|
||||
|
|
Loading…
Reference in a new issue