diff options
Diffstat (limited to 'src/widgets/styles')
| -rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 21 | ||||
| -rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 13 |
2 files changed, 19 insertions, 15 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index c4b78539114..bb9f7ab27fc 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -5,15 +5,12 @@ #include "qcommonstyle.h" #include "qcommonstyle_p.h" -#include <qfile.h> #if QT_CONFIG(itemviews) #include <qabstractitemview.h> #endif #include <qapplication.h> #include <private/qguiapplication_p.h> #include <qpa/qplatformtheme.h> -#include <qbitmap.h> -#include <qcache.h> #if QT_CONFIG(dockwidget) #include <qdockwidget.h> #endif @@ -61,7 +58,6 @@ #endif #include <private/qcommonstylepixmaps_p.h> #include <private/qmath_p.h> -#include <qdebug.h> #include <qtextformat.h> #if QT_CONFIG(wizard) #include <qwizard.h> @@ -69,11 +65,6 @@ #if QT_CONFIG(filedialog) #include <qsidebar_p.h> #endif -#include <qfileinfo.h> -#include <qdir.h> -#if QT_CONFIG(settings) -#include <qsettings.h> -#endif #include <qvariant.h> #include <qpixmapcache.h> #if QT_CONFIG(animation) @@ -6199,17 +6190,17 @@ QPixmap QCommonStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &p return QPixmap::fromImage(std::move(im)); } case QIcon::Selected: { - QImage img = pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); QColor color = opt->palette.color(QPalette::Normal, QPalette::Highlight); color.setAlphaF(0.3f); - QPainter painter(&img); + QPixmap ret(pixmap); + QPainter painter(&ret); painter.setCompositionMode(QPainter::CompositionMode_SourceAtop); - painter.fillRect(0, 0, img.width(), img.height(), color); + painter.fillRect(0, 0, pixmap.width(), pixmap.height(), color); painter.end(); - return QPixmap::fromImage(std::move(img)); } + return ret; + } case QIcon::Active: - return pixmap; - default: + case QIcon::Normal: break; } return pixmap; diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 9b06822c218..b9143a59ee7 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -851,6 +851,12 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, } #ifndef QT_NO_FRAME case PE_Frame: + if (w && w->inherits("QComboBoxPrivateContainer")){ + QStyleOption copy = *opt; + copy.state |= State_Raised; + proxy()->drawPrimitive(PE_PanelMenu, ©, p, w); + break; + } case PE_FrameMenu: if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { if (frame->lineWidth == 2 || pe == PE_Frame) { @@ -873,6 +879,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, } } else { QPalette popupPal = opt->palette; + p->drawRect(opt->rect); popupPal.setColor(QPalette::Light, opt->palette.window().color()); popupPal.setColor(QPalette::Midlight, opt->palette.light().color()); qDrawWinPanel(p, opt->rect, popupPal, opt->state & State_Sunken); @@ -899,6 +906,12 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, p->drawRect(opt->rect); } break; } + case PE_PanelMenu: + if (w && w->inherits("QComboBoxPrivateContainer")){ + const QBrush menuBackground = opt->palette.base().color(); + QColor borderColor = opt->palette.window().color(); + qDrawPlainRect(p, opt->rect, borderColor, 1, &menuBackground); + } case PE_FrameWindow: { QPalette popupPal = opt->palette; popupPal.setColor(QPalette::Light, opt->palette.window().color()); |
