Mac: Transient scrollbars should overlap in the corner on 10.8
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>
Wed, 5 Dec 2012 15:20:12 +0000 (16:20 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 6 Dec 2012 15:45:52 +0000 (16:45 +0100)
Change-Id: Ied239d5e3cb05bed6b892607f0344e6daa028918
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
src/widgets/widgets/qabstractscrollarea.cpp

index 3c21d76..2a3bdb0 100644 (file)
@@ -489,12 +489,20 @@ void QAbstractScrollAreaPrivate::layoutChildren()
         if (hasMacReverseSizeGrip)
             horizontalScrollBarRect.adjust(vsbExt, 0, 0, 0);
 #endif
+#ifdef Q_OS_MAC
+        if (!hasCornerWidget && QSysInfo::macVersion() >= QSysInfo::MV_10_8 && q->style()->styleHint(QStyle::SH_ScrollBar_Transient))
+            horizontalScrollBarRect.adjust(0, 0, cornerOffset.x(), 0);
+#endif
         scrollBarContainers[Qt::Horizontal]->setGeometry(QStyle::visualRect(opt.direction, opt.rect, horizontalScrollBarRect));
         scrollBarContainers[Qt::Horizontal]->raise();
     }
 
     if (needv) {
-        const QRect verticalScrollBarRect  (QPoint(cornerPoint.x(), controlsRect.top() + hHeaderBottom),  QPoint(controlsRect.right(), cornerPoint.y() - 1));
+        QRect verticalScrollBarRect  (QPoint(cornerPoint.x(), controlsRect.top() + hHeaderBottom),  QPoint(controlsRect.right(), cornerPoint.y() - 1));
+#ifdef Q_OS_MAC
+        if (!hasCornerWidget && QSysInfo::macVersion() >= QSysInfo::MV_10_8 && q->style()->styleHint(QStyle::SH_ScrollBar_Transient))
+            verticalScrollBarRect.adjust(0, 0, 0, cornerOffset.y());
+#endif
         scrollBarContainers[Qt::Vertical]->setGeometry(QStyle::visualRect(opt.direction, opt.rect, verticalScrollBarRect));
         scrollBarContainers[Qt::Vertical]->raise();
     }