From 0d8a186ce78d9298936fb73af24e796a7263bf46 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Thu, 15 Jan 2009 02:15:10 +0000 Subject: [PATCH] Backport r911207. Add 4px padding between the title text and the stripes so that it doesn't look so cramped. svn path=/branches/KDE/4.2/kdebase/workspace/; revision=911212 --- clients/oxygen/oxygenclient.cpp | 8 ++++---- clients/ozone/oxygenclient.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index 53c6f53aaa..bd24dc422a 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -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); diff --git a/clients/ozone/oxygenclient.cpp b/clients/ozone/oxygenclient.cpp index 2c56c0f10b..39e9d52628 100644 --- a/clients/ozone/oxygenclient.cpp +++ b/clients/ozone/oxygenclient.cpp @@ -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);