From 4ef8144dd6a7a4e493c901c3d1d4bbb7735c161c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 21 Aug 2013 13:52:48 +0200 Subject: QWidget: Apply window opacity set before show. Task-number: QTBUG-33078 Change-Id: Id9111f223a9dc58c88b072c52e36d42db450573a Reviewed-by: Shawn Rutledge --- src/widgets/kernel/qwidget_qpa.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index f0846bea6b..665aa4b17a 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -900,6 +900,8 @@ void QWidgetPrivate::createTLSysExtra() extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh)); if (extra->maxw != QWIDGETSIZE_MAX || extra->maxh != QWIDGETSIZE_MAX) extra->topextra->window->setMaximumSize(QSize(extra->maxw, extra->maxh)); + if (extra->topextra->opacity != 255 && q->isWindow()) + extra->topextra->window->setOpacity(qreal(extra->topextra->opacity) / qreal(255)); #ifdef Q_OS_WIN // Pass on native parent handle for Widget embedded into Active X. const QVariant activeXNativeParentHandle = q->property(activeXNativeParentHandleProperty); -- cgit v1.2.3 From 61948f84da12432b9b8b178875a86f54fef12e32 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 22 Aug 2013 17:43:54 +0300 Subject: Fix scrollbar appearance on Win8 Task-number: QTBUG-26503 Change-Id: Id74821e005483d05450467fcaea672bbf35113bc Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qwindowsvistastyle.cpp | 46 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index e442e53bde..22458eb96f 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -1830,29 +1830,31 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle int gw = size.cx, gh = size.cy; - QRect gripperBounds; - if (flags & State_Horizontal && ((swidth - contentsMargin.cxLeftWidth - contentsMargin.cxRightWidth) > gw)) { - gripperBounds.setLeft(theme.rect.left() + swidth/2 - gw/2); - gripperBounds.setTop(theme.rect.top() + sheight/2 - gh/2); - gripperBounds.setWidth(gw); - gripperBounds.setHeight(gh); - } else if ((sheight - contentsMargin.cyTopHeight - contentsMargin.cyBottomHeight) > gh) { - gripperBounds.setLeft(theme.rect.left() + swidth/2 - gw/2); - gripperBounds.setTop(theme.rect.top() + sheight/2 - gh/2); - gripperBounds.setWidth(gw); - gripperBounds.setHeight(gh); - } + if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8) { + QRect gripperBounds; + if (flags & State_Horizontal && ((swidth - contentsMargin.cxLeftWidth - contentsMargin.cxRightWidth) > gw)) { + gripperBounds.setLeft(theme.rect.left() + swidth/2 - gw/2); + gripperBounds.setTop(theme.rect.top() + sheight/2 - gh/2); + gripperBounds.setWidth(gw); + gripperBounds.setHeight(gh); + } else if ((sheight - contentsMargin.cyTopHeight - contentsMargin.cyBottomHeight) > gh) { + gripperBounds.setLeft(theme.rect.left() + swidth/2 - gw/2); + gripperBounds.setTop(theme.rect.top() + sheight/2 - gh/2); + gripperBounds.setWidth(gw); + gripperBounds.setHeight(gh); + } - // Draw gripper if there is enough space - if (!gripperBounds.isEmpty() && flags & State_Enabled) { - painter->save(); - XPThemeData grippBackground = theme; - grippBackground.partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; - theme.rect = gripperBounds; - painter->setClipRegion(d->region(theme));// Only change inside the region of the gripper - d->drawBackground(grippBackground);// The gutter is the grippers background - d->drawBackground(theme); // Transparent gripper ontop of background - painter->restore(); + // Draw gripper if there is enough space + if (!gripperBounds.isEmpty() && flags & State_Enabled) { + painter->save(); + XPThemeData grippBackground = theme; + grippBackground.partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; + theme.rect = gripperBounds; + painter->setClipRegion(d->region(theme));// Only change inside the region of the gripper + d->drawBackground(grippBackground);// The gutter is the grippers background + d->drawBackground(theme); // Transparent gripper ontop of background + painter->restore(); + } } } } -- cgit v1.2.3 From 10e23c84d5cbd40ca054a2040e0fac38c248b34d Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 14 Aug 2013 19:06:34 +0200 Subject: Style: Remove useless background paint for menu scroller This would also cause an extra paint in QQuickStyleItem, resulting in the frame being erased for those styles not having a frame width set (e.g., fusion and GTK). Change-Id: I7a9371c540cd31fd9f1400a51c4ec57582996dd2 Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qcommonstyle.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 936eb76dad..ba6c222820 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1329,7 +1329,6 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, break; #ifndef QT_NO_MENU case CE_MenuScroller: { - p->fillRect(opt->rect, opt->palette.background()); QStyleOption arrowOpt = *opt; arrowOpt.state |= State_Enabled; proxy()->drawPrimitive(((opt->state & State_DownArrow) ? PE_IndicatorArrowDown : PE_IndicatorArrowUp), -- cgit v1.2.3