QMacStyle: enable transient scrollbars for the desktop components

Change-Id: I4f57a2c4eade779c594abaacaa872540b3b23cb1
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
J-P Nurmi 2013-01-25 16:58:23 +01:00 committed by The Qt Project
parent 90361fd36c
commit ec51ad81ff

View File

@ -2707,15 +2707,14 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
ret = false;
break;
case SH_ScrollBar_Transient:
if (!qobject_cast<const QScrollBar*>(w)) {
ret = false;
break;
}
ret = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7;
if (qobject_cast<const QScrollBar *>(w) ||
(opt && QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ScrollBar))) {
ret = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7)
ret &= [NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay;
if (ret)
ret = [NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay;
#endif
}
break;
default:
ret = QCommonStyle::styleHint(sh, opt, w, hret);
@ -4920,7 +4919,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (cc == CC_ScrollBar && proxy()->styleHint(SH_ScrollBar_Transient, 0, widget)) {
if (cc == CC_ScrollBar && proxy()->styleHint(SH_ScrollBar_Transient, opt, widget)) {
bool wasActive = false;
CGFloat opacity = 1.0;
CGFloat expandScale = 1.0;