Commit d8f46c39 authored by Lucas Murray's avatar Lucas Murray
Browse files

Add 4px padding between the title text and the stripes so that it

doesn't look so cramped.

svn path=/trunk/KDE/kdebase/workspace/; revision=911207
parent 07d5e9cf
......@@ -337,20 +337,20 @@ void OxygenClient::paintEvent(QPaintEvent *e)
}
if (align & Qt::AlignLeft) {
int left = titleLeft + QFontMetrics(options()->font(isActive(), false)).width(caption());
int left = titleLeft + QFontMetrics(options()->font(isActive(), false)).width(caption()) + 4;
int right = titleLeft + titleWidth;
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());
int right = titleLeft + titleWidth - QFontMetrics(options()->font(isActive(), false)).width(caption()) - 4;
drawScratch(&painter, palette, right, left, titleTop+6);
}
if (align & Qt::AlignHCenter) {
int textWidth = QFontMetrics(options()->font(isActive(), false)).width(caption());
int left = titleLeft;
int centerLeft = titleLeft + titleWidth/2 - textWidth/2;
int centerRight = titleLeft + titleWidth/2 + textWidth/2;
int centerLeft = titleLeft + titleWidth/2 - textWidth/2 - 4;
int centerRight = titleLeft + titleWidth/2 + textWidth/2 + 4;
int right = titleLeft + titleWidth;
drawScratch(&painter, palette, centerLeft, left, titleTop+6);
drawScratch(&painter, palette, centerRight, right, titleTop+6);
......
......@@ -346,20 +346,20 @@ void OxygenClient::paintEvent(QPaintEvent *e)
}
if (align & Qt::AlignLeft) {
int left = titleLeft + QFontMetrics(options()->font(isActive(), false)).width(caption());
int left = titleLeft + QFontMetrics(options()->font(isActive(), false)).width(caption()) + 4;
int right = titleLeft + titleWidth;
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());
int right = titleLeft + titleWidth - QFontMetrics(options()->font(isActive(), false)).width(caption()) - 4;
drawScratch(&painter, palette, right, left, titleTop+6);
}
if (align & Qt::AlignHCenter) {
int textWidth = QFontMetrics(options()->font(isActive(), false)).width(caption());
int left = titleLeft;
int centerLeft = titleLeft + titleWidth/2 - textWidth/2;
int centerRight = titleLeft + titleWidth/2 + textWidth/2;
int centerLeft = titleLeft + titleWidth/2 - textWidth/2 - 4;
int centerRight = titleLeft + titleWidth/2 + textWidth/2 + 4;
int right = titleLeft + titleWidth;
drawScratch(&painter, palette, centerLeft, left, titleTop+6);
drawScratch(&painter, palette, centerRight, right, titleTop+6);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment