diff --git a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp index 2737b1f8a94..6a003c2e7b2 100644 --- a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp +++ b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp @@ -4901,7 +4901,7 @@ QIcon QWindowsVistaStyle::standardIcon(StandardPixmap standardIcon, switch (standardIcon) { case SP_TitleBarMaxButton: if (qstyleoption_cast(option)) { - if (d->dockFloat.isNull()) { + if (d->m_titleBarMaxIcon.isNull()) { QWindowsThemeData themeSize(nullptr, nullptr, QWindowsVistaStylePrivate::WindowTheme, WP_SMALLCLOSEBUTTON, CBS_NORMAL); QWindowsThemeData theme(nullptr, nullptr, QWindowsVistaStylePrivate::WindowTheme, @@ -4914,29 +4914,29 @@ QIcon QWindowsVistaStyle::standardIcon(StandardPixmap standardIcon, theme.painter = &p; theme.rect = QRect(QPoint(0, 0), size); d->drawBackground(theme); - d->dockFloat.addPixmap(pm, QIcon::Normal, QIcon::Off); // Normal + d->m_titleBarMaxIcon.addPixmap(pm, QIcon::Normal, QIcon::Off); // Normal pm.fill(Qt::transparent); theme.stateId = MAXBS_PUSHED; d->drawBackground(theme); - d->dockFloat.addPixmap(pm, QIcon::Normal, QIcon::On); // Pressed + d->m_titleBarMaxIcon.addPixmap(pm, QIcon::Normal, QIcon::On); // Pressed pm.fill(Qt::transparent); theme.stateId = MAXBS_HOT; d->drawBackground(theme); - d->dockFloat.addPixmap(pm, QIcon::Active, QIcon::Off); // Hover + d->m_titleBarMaxIcon.addPixmap(pm, QIcon::Active, QIcon::Off); // Hover pm.fill(Qt::transparent); theme.stateId = MAXBS_INACTIVE; d->drawBackground(theme); - d->dockFloat.addPixmap(pm, QIcon::Disabled, QIcon::Off); // Disabled + d->m_titleBarMaxIcon.addPixmap(pm, QIcon::Disabled, QIcon::Off); // Disabled } } if (widget && widget->isWindow()) - return d->dockFloat; + return d->m_titleBarMaxIcon; } break; case SP_TitleBarCloseButton: if (qstyleoption_cast(option)) { - if (d->dockClose.isNull()) { + if (d->m_titleBarCloseIcon.isNull()) { QWindowsThemeData theme(nullptr, nullptr, QWindowsVistaStylePrivate::WindowTheme, WP_SMALLCLOSEBUTTON, CBS_NORMAL); if (theme.isValid()) { @@ -4948,29 +4948,29 @@ QIcon QWindowsVistaStyle::standardIcon(StandardPixmap standardIcon, theme.partId = WP_CLOSEBUTTON; // #### theme.rect = QRect(QPoint(0, 0), size); d->drawBackground(theme); - d->dockClose.addPixmap(pm, QIcon::Normal, QIcon::Off); // Normal + d->m_titleBarCloseIcon.addPixmap(pm, QIcon::Normal, QIcon::Off); // Normal pm.fill(Qt::transparent); theme.stateId = CBS_PUSHED; d->drawBackground(theme); - d->dockClose.addPixmap(pm, QIcon::Normal, QIcon::On); // Pressed + d->m_titleBarCloseIcon.addPixmap(pm, QIcon::Normal, QIcon::On); // Pressed pm.fill(Qt::transparent); theme.stateId = CBS_HOT; d->drawBackground(theme); - d->dockClose.addPixmap(pm, QIcon::Active, QIcon::Off); // Hover + d->m_titleBarCloseIcon.addPixmap(pm, QIcon::Active, QIcon::Off); // Hover pm.fill(Qt::transparent); theme.stateId = CBS_INACTIVE; d->drawBackground(theme); - d->dockClose.addPixmap(pm, QIcon::Disabled, QIcon::Off); // Disabled + d->m_titleBarCloseIcon.addPixmap(pm, QIcon::Disabled, QIcon::Off); // Disabled } } if (widget && widget->isWindow()) - return d->dockClose; + return d->m_titleBarCloseIcon; } break; case SP_TitleBarNormalButton: if (qstyleoption_cast(option)) { - if (d->dockFloat.isNull()) { + if (d->m_titleBarNormalIcon.isNull()) { QWindowsThemeData themeSize(nullptr, nullptr, QWindowsVistaStylePrivate::WindowTheme, WP_SMALLCLOSEBUTTON, CBS_NORMAL); QWindowsThemeData theme(nullptr, nullptr, QWindowsVistaStylePrivate::WindowTheme, @@ -4983,23 +4983,23 @@ QIcon QWindowsVistaStyle::standardIcon(StandardPixmap standardIcon, theme.painter = &p; theme.rect = QRect(QPoint(0, 0), size); d->drawBackground(theme); - d->dockFloat.addPixmap(pm, QIcon::Normal, QIcon::Off); // Normal + d->m_titleBarNormalIcon.addPixmap(pm, QIcon::Normal, QIcon::Off); // Normal pm.fill(Qt::transparent); theme.stateId = RBS_PUSHED; d->drawBackground(theme); - d->dockFloat.addPixmap(pm, QIcon::Normal, QIcon::On); // Pressed + d->m_titleBarNormalIcon.addPixmap(pm, QIcon::Normal, QIcon::On); // Pressed pm.fill(Qt::transparent); theme.stateId = RBS_HOT; d->drawBackground(theme); - d->dockFloat.addPixmap(pm, QIcon::Active, QIcon::Off); // Hover + d->m_titleBarNormalIcon.addPixmap(pm, QIcon::Active, QIcon::Off); // Hover pm.fill(Qt::transparent); theme.stateId = RBS_INACTIVE; d->drawBackground(theme); - d->dockFloat.addPixmap(pm, QIcon::Disabled, QIcon::Off); // Disabled + d->m_titleBarNormalIcon.addPixmap(pm, QIcon::Disabled, QIcon::Off); // Disabled } } if (widget && widget->isWindow()) - return d->dockFloat; + return d->m_titleBarNormalIcon; } break; diff --git a/src/plugins/styles/modernwindows/qwindowsvistastyle_p_p.h b/src/plugins/styles/modernwindows/qwindowsvistastyle_p_p.h index 506a097b2b2..e2bd915a2b2 100644 --- a/src/plugins/styles/modernwindows/qwindowsvistastyle_p_p.h +++ b/src/plugins/styles/modernwindows/qwindowsvistastyle_p_p.h @@ -148,11 +148,15 @@ public: QRgb groupBoxTextColorDisabled = 0; QRgb sliderTickColor = 0; bool hasInitColors = false; - QIcon dockFloat, dockClose; QTime animationTime() const; bool transitionsEnabled() const; +protected: + QIcon m_titleBarMaxIcon; + QIcon m_titleBarCloseIcon; + QIcon m_titleBarNormalIcon; + private: static bool initVistaTreeViewTheming(const QScreen *screen); static void cleanupVistaTreeViewTheming();