summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-06-05 12:52:34 (GMT)
committerSami Merilä <sami.merila@nokia.com>2009-06-05 12:52:34 (GMT)
commit541a387770966eb78958b38fe49fc62c2063b4c3 (patch)
tree4aed34104f1be364e70a9d74f3668d35cf07ee52
parent6bebfe4c8003b2e0e4758488cc5459d7dd18106d (diff)
downloadQt-541a387770966eb78958b38fe49fc62c2063b4c3.zip
Qt-541a387770966eb78958b38fe49fc62c2063b4c3.tar.gz
Qt-541a387770966eb78958b38fe49fc62c2063b4c3.tar.bz2
S60Style: Drop middlesection from tab graphics, if there is very little of tab content.
-rw-r--r--src/gui/styles/qs60style.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 83f5a6b..dbc0fe0 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -560,10 +560,20 @@ void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start,
startRect.setWidth(qMin(rect.width() >>1 - 1, startRect.width()));
endRect = startRect.translated(rect.width() - startRect.width(), 0);
middleRect.adjust(startRect.width(), 0, -startRect.width(), 0);
+ if (startRect.bottomRight().x() > endRect.topLeft().x()) {
+ const int overlap = (startRect.bottomRight().x() - endRect.topLeft().x())>>1;
+ startRect.setWidth(startRect.width()-overlap);
+ endRect.adjust(overlap,0,0,0);
+ }
} else {
startRect.setHeight(qMin(rect.height() >>1 - 1, startRect.height()));
endRect = startRect.translated(0, rect.height() - startRect.height());
middleRect.adjust(0, startRect.height(), 0, -startRect.height());
+ if (startRect.topRight().y() > endRect.bottomLeft().y()) {
+ const int overlap = (startRect.topRight().y() - endRect.bottomLeft().y())>>1;
+ startRect.setHeight(startRect.height()-overlap);
+ endRect.adjust(0,overlap,0,0);
+ }
}
#if 0