diff options
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index c2a720c433..5d0432d2e0 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -434,16 +434,26 @@ struct QStyleSheetBoxData : public QSharedData struct QStyleSheetPaletteData : public QSharedData { - QStyleSheetPaletteData(const QBrush &fg, const QBrush &sfg, const QBrush &sbg, - const QBrush &abg, const QBrush &pfg) - : foreground(fg), selectionForeground(sfg), selectionBackground(sbg), - alternateBackground(abg), placeholderForeground(pfg) { } + QStyleSheetPaletteData(const QBrush &foreground, + const QBrush &selectedForeground, + const QBrush &selectedBackground, + const QBrush &alternateBackground, + const QBrush &placeHolderTextForeground, + const QBrush &accentColor) + : foreground(foreground) + , selectionForeground(selectedForeground) + , selectionBackground(selectedBackground) + , alternateBackground(alternateBackground) + , placeholderForeground(placeHolderTextForeground) + , accentColor(accentColor) + { } QBrush foreground; QBrush selectionForeground; QBrush selectionBackground; QBrush alternateBackground; QBrush placeholderForeground; + QBrush accentColor; }; struct QStyleSheetGeometryData : public QSharedData @@ -955,10 +965,17 @@ QRenderRule::QRenderRule(const QList<Declaration> &declarations, const QObject * bg = new QStyleSheetBackgroundData(brush, pixmap, repeat, alignment, origin, attachment, clip); } - QBrush sfg, fg, pfg; - QBrush sbg, abg; - if (v.extractPalette(&fg, &sfg, &sbg, &abg, &pfg)) - pal = new QStyleSheetPaletteData(fg, sfg, sbg, abg, pfg); + QBrush foreground; + QBrush selectedForeground; + QBrush selectedBackground; + QBrush alternateBackground; + QBrush placeHolderTextForeground; + QBrush accentColor; + if (v.extractPalette(&foreground, &selectedForeground, &selectedBackground, + &alternateBackground, &placeHolderTextForeground, &accentColor)) { + pal = new QStyleSheetPaletteData(foreground, selectedForeground, selectedBackground, + alternateBackground, placeHolderTextForeground, accentColor); + } QIcon imgIcon; alignment = Qt::AlignCenter; @@ -1487,6 +1504,8 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const Q p->setBrush(cg, QPalette::AlternateBase, pal->alternateBackground); if (pal->placeholderForeground.style() != Qt::NoBrush) p->setBrush(cg, QPalette::PlaceholderText, pal->placeholderForeground); + if (pal->accentColor.style() != Qt::NoBrush) + p->setBrush(cg, QPalette::AccentColor, pal->accentColor); } bool QRenderRule::hasModification() const |