summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-04-06 15:52:58 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-04-07 05:50:14 (GMT)
commitc40d4b7180be3ff33ced7d09e11d8607f475190c (patch)
tree9222f984b5cbd9ef59ea5c44a2b1168e702ca76b /src
parent52792607c7a0099a8261fb66b93323406c826bfe (diff)
downloadQt-c40d4b7180be3ff33ced7d09e11d8607f475190c.zip
Qt-c40d4b7180be3ff33ced7d09e11d8607f475190c.tar.gz
Qt-c40d4b7180be3ff33ced7d09e11d8607f475190c.tar.bz2
BT: Fixed treeview painting regression on Vista
The old code did not split up the frame from the central parts of the itemview selection box correctly. We now draw the edges as border images instead. Previously this would lead to somewhat ugly scaling artifacts for small header sections. Task: 248839 Reviewed-by: ogoffart (cherry picked from commit 041a8ecdb5f11dfc499f8f8f77d85cb63508c093)
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index 4c3060d..b14b8b3 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -801,12 +801,20 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
if (vopt->viewItemPosition == QStyleOptionViewItemV4::OnlyOne
|| vopt->viewItemPosition == QStyleOptionViewItemV4::Invalid)
painter->drawPixmap(pixmapRect.topLeft(), pixmap);
- else if (reverse ? rightSection : leftSection)
- painter->drawPixmap(pixmapRect, pixmap, srcRect.adjusted(0, 0, -frame, 0));
- else if (reverse ? leftSection : rightSection)
- painter->drawPixmap(pixmapRect, pixmap,
- srcRect.adjusted(frame, 0, 0, 0));
- else if (vopt->viewItemPosition == QStyleOptionViewItemV4::Middle)
+ else if (reverse ? rightSection : leftSection){
+ painter->drawPixmap(QRect(pixmapRect.topLeft(),
+ QSize(frame, pixmapRect.height())), pixmap,
+ QRect(QPoint(0, 0), QSize(frame, pixmapRect.height())));
+ painter->drawPixmap(pixmapRect.adjusted(frame, 0, 0, 0),
+ pixmap, srcRect.adjusted(frame, 0, -frame, 0));
+ } else if (reverse ? leftSection : rightSection) {
+ painter->drawPixmap(QRect(pixmapRect.topRight() - QPoint(frame - 1, 0),
+ QSize(frame, pixmapRect.height())), pixmap,
+ QRect(QPoint(pixmapRect.width() - frame, 0),
+ QSize(frame, pixmapRect.height())));
+ painter->drawPixmap(pixmapRect.adjusted(0, 0, -frame, 0),
+ pixmap, srcRect.adjusted(frame, 0, -frame, 0));
+ } else if (vopt->viewItemPosition == QStyleOptionViewItemV4::Middle)
painter->drawPixmap(pixmapRect, pixmap,
srcRect.adjusted(frame, 0, -frame, 0));
} else {