summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-14 12:45:48 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-14 12:45:48 (GMT)
commit8cf08f2640e31615bba0cc61544642855dc1275e (patch)
tree7734bbaad929c6d461e0b71f9007a9a41ffe6149 /src/gui/styles
parentccd85016aa7d95495ab113bd5cecc62769a5fad4 (diff)
parentfcd009cd77f95106f4522103bab9aaf86109a17d (diff)
downloadQt-8cf08f2640e31615bba0cc61544642855dc1275e.zip
Qt-8cf08f2640e31615bba0cc61544642855dc1275e.tar.gz
Qt-8cf08f2640e31615bba0cc61544642855dc1275e.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: QAbstractScrollArea StyleSheet: fix drawing of border with SH_ScrollView_FrameOnlyAroundContents
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index c550938..285a789 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -4242,8 +4242,15 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w)) {
const QAbstractScrollAreaPrivate *sap = sa->d_func();
rule.drawBackground(p, opt->rect, sap->contentsOffset());
- if (rule.hasBorder())
- rule.drawBorder(p, rule.borderRect(opt->rect));
+ if (rule.hasBorder()) {
+ QRect brect = rule.borderRect(opt->rect);
+ if (styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, opt, w)) {
+ QRect r = brect.adjusted(0, 0, sa->verticalScrollBar()->isVisible() ? -sa->verticalScrollBar()->width() : 0,
+ sa->horizontalScrollBar()->isVisible() ? -sa->horizontalScrollBar()->height() : 0);
+ brect = QStyle::visualRect(opt->direction, brect, r);
+ }
+ rule.drawBorder(p, brect);
+ }
break;
}
#endif
@@ -4628,6 +4635,11 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const
return msz.width() == -1 ? msz.height() : msz.width();
}
break;
+
+ case PM_ScrollView_ScrollBarSpacing:
+ if(!rule.hasNativeBorder() || rule.hasBox())
+ return 0;
+ break;
#endif // QT_NO_SCROLLBAR
case PM_ProgressBarChunkWidth: