diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-05-23 21:27:07 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-05-23 21:27:07 +0200 |
commit | d3a8bc803cd7c4ce106038bfc4b37cdd6bb8e177 (patch) | |
tree | 3b6db0d4869f334d0eb4559c5ae457995cbe913e /src/widgets/styles | |
parent | d934ddc297f6db94dbc548fe01da64350f13577d (diff) | |
parent | 47a7628023610904c6ac52e23fa289f75f349b4e (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/corelib/io/qdatastream.cpp
src/corelib/io/qdatastream.h
src/corelib/json/qjsonwriter.cpp
src/plugins/platforms/cocoa/qcocoawindow.mm
src/plugins/platforms/xcb/qxcbkeyboard.cpp
Change-Id: I46fef1455f5a9f2ce1ec394a3c65881093c51b62
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qfusionstyle_p_p.h | 6 | ||||
-rw-r--r-- | src/widgets/styles/qgtkstyle_p.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 28 | ||||
-rw-r--r-- | src/widgets/styles/qstyleoption.cpp | 2 |
4 files changed, 26 insertions, 14 deletions
diff --git a/src/widgets/styles/qfusionstyle_p_p.h b/src/widgets/styles/qfusionstyle_p_p.h index acdf409dbf..a76ed24a4a 100644 --- a/src/widgets/styles/qfusionstyle_p_p.h +++ b/src/widgets/styles/qfusionstyle_p_p.h @@ -88,7 +88,7 @@ public: // On mac we want a standard blue color used when the system palette is used bool isMacSystemPalette(const QPalette &pal) const { Q_UNUSED(pal); -#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) +#if defined(Q_OS_MACX) const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette(); if (themePalette && themePalette->color(QPalette::Normal, QPalette::Highlight) == pal.color(QPalette::Normal, QPalette::Highlight) && @@ -102,13 +102,13 @@ public: QColor highlight(const QPalette &pal) const { if (isMacSystemPalette(pal)) return QColor(60, 140, 230); - return pal.color(QPalette::Active, QPalette::Highlight); + return pal.color(QPalette::Highlight); } QColor highlightedText(const QPalette &pal) const { if (isMacSystemPalette(pal)) return Qt::white; - return pal.color(QPalette::Active, QPalette::HighlightedText); + return pal.color(QPalette::HighlightedText); } QColor outline(const QPalette &pal) const { diff --git a/src/widgets/styles/qgtkstyle_p.cpp b/src/widgets/styles/qgtkstyle_p.cpp index a53a961a89..769d822108 100644 --- a/src/widgets/styles/qgtkstyle_p.cpp +++ b/src/widgets/styles/qgtkstyle_p.cpp @@ -641,7 +641,9 @@ QString QGtkStylePrivate::getGConfString(const QString &value, const QString &fa { QString retVal = fallback; if (resolveGConf()) { +#if !defined(GLIB_VERSION_2_36) g_type_init(); +#endif GConfClient* client = gconf_client_get_default(); GError *err = 0; char *str = gconf_client_get_string(client, qPrintable(value), &err); @@ -660,7 +662,9 @@ bool QGtkStylePrivate::getGConfBool(const QString &key, bool fallback) { bool retVal = fallback; if (resolveGConf()) { +#if !defined(GLIB_VERSION_2_36) g_type_init(); +#endif GConfClient* client = gconf_client_get_default(); GError *err = 0; bool result = gconf_client_get_bool(client, qPrintable(key), &err); diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 8ff6419075..b7f39d45dd 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -840,7 +840,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg : kThemeGrowRight | kThemeGrowDown; gbi.size = sz == QAquaSizeSmall ? kHIThemeGrowBoxSizeSmall : kHIThemeGrowBoxSizeNormal; if (HIThemeGetGrowBoxBounds(&p, &gbi, &r) == noErr) - ret = QSize(r.size.width, r.size.height); + ret = QSize(QSysInfo::MacintoshVersion <= QSysInfo::MV_10_6 ? r.size.width : 0, r.size.height); } break; case QStyle::CT_ComboBox: @@ -3643,8 +3643,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter tti.version = qt_mac_hitheme_version; tti.state = tds; QColor textColor = btn->palette.buttonText().color(); - CGFloat colorComp[] = { textColor.redF(), textColor.greenF(), - textColor.blueF(), textColor.alphaF() }; + CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()), + static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) }; CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace()); CGContextSetFillColor(cg, colorComp); tti.fontID = themeId; @@ -3883,8 +3883,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter tti.version = qt_mac_hitheme_version; tti.state = tds; QColor textColor = myTab.palette.windowText().color(); - CGFloat colorComp[] = { textColor.redF(), textColor.greenF(), - textColor.blueF(), textColor.alphaF() }; + CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()), + static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) }; CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace()); CGContextSetFillColor(cg, colorComp); switch (d->aquaSizeConstrain(opt, w)) { @@ -4063,8 +4063,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter CGContextSetShouldAntialias(cg, true); CGContextSetShouldSmoothFonts(cg, true); QColor textColor = p->pen().color(); - CGFloat colorComp[] = { textColor.redF(), textColor.greenF(), - textColor.blueF(), textColor.alphaF() }; + CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()), + static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) }; CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace()); CGContextSetFillColor(cg, colorComp); HIThemeTextInfo tti; @@ -4316,6 +4316,10 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter case CE_ProgressBarGroove: break; case CE_SizeGrip: { + // We do not draw size grips on versions > 10.6 + if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_6) + break; + if (w && w->testAttribute(Qt::WA_MacOpaqueSizeGrip)) { HIThemeGrowBoxDrawInfo gdi; gdi.version = qt_mac_hitheme_version; @@ -4947,7 +4951,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, opt, widget)) { bool wasActive = false; - CGFloat opacity = 1.0; + CGFloat opacity = 0.0; CGFloat expandScale = 1.0; CGFloat expandOffset = -1.0; bool shouldExpand = false; @@ -4973,6 +4977,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex oldState != slider->state || oldActiveControls != slider->activeSubControls) { + // if the scrollbar is transient or its attributes, geometry or + // state has changed, the opacity is reset back to 100% opaque + opacity = 1.0; + styleObject->setProperty("_q_stylepos", slider->sliderPosition); styleObject->setProperty("_q_stylemin", slider->minimum); styleObject->setProperty("_q_stylemax", slider->maximum); @@ -5371,8 +5379,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex tti.version = qt_mac_hitheme_version; tti.state = tds; QColor textColor = groupBox.palette.windowText().color(); - CGFloat colorComp[] = { textColor.redF(), textColor.greenF(), - textColor.blueF(), textColor.alphaF() }; + CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()), + static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) }; CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace()); CGContextSetFillColor(cg, colorComp); tti.fontID = flat ? kThemeSystemFont : kThemeSmallSystemFont; diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 4f4cd71070..5fe071087e 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -206,7 +206,7 @@ void QStyleOption::init(const QWidget *widget) if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget)) state &= ~QStyle::State_Enabled; #endif -#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) +#if defined(Q_OS_MACX) switch (QMacStyle::widgetSizePolicy(widget)) { case QMacStyle::SizeSmall: state |= QStyle::State_Small; |