Commit 21905cfe authored by Jan Blackquill's avatar Jan Blackquill 🌈 Committed by Nate Graham
Browse files

kcms/colors: make sure the preview uses the right colours

BUG: 456648


(cherry picked from commit 7a1c4067)
parent b06fc87d
Pipeline #207891 passed with stage
in 6 minutes and 8 seconds
......@@ -52,6 +52,8 @@ QVariant ColorsModel::data(const QModelIndex &index, int role) const
return item.schemeName;
case PaletteRole:
return item.palette;
case DisabledText:
return item.palette.color(QPalette::Disabled, QPalette::Text);
case ActiveTitleBarBackgroundRole:
return item.activeTitleBarBackground;
case ActiveTitleBarForegroundRole:
......@@ -110,6 +112,7 @@ QHash<int, QByteArray> ColorsModel::roleNames() const
{PaletteRole, QByteArrayLiteral("palette")},
{ActiveTitleBarBackgroundRole, QByteArrayLiteral("activeTitleBarBackground")},
{ActiveTitleBarForegroundRole, QByteArrayLiteral("activeTitleBarForeground")},
{DisabledText, QByteArrayLiteral("disabledText")},
{RemovableRole, QByteArrayLiteral("removable")},
{AccentActiveTitlebarRole, QByteArrayLiteral("accentActiveTitlebar")},
{PendingDeletionRole, QByteArrayLiteral("pendingDeletion")},
......
......@@ -45,6 +45,7 @@ public:
// Colors which aren't in QPalette
ActiveTitleBarBackgroundRole,
ActiveTitleBarForegroundRole,
DisabledText,
RemovableRole,
AccentActiveTitlebarRole,
PendingDeletionRole,
......
......@@ -394,6 +394,8 @@ KCM.GridViewKCM {
QtControls.Button {
Layout.alignment: Qt.AlignBottom
text: i18n("Button")
Kirigami.Theme.inherit: false
Kirigami.Theme.highlightColor: kcm.tinted(root.accentColor ? kcm.accentBackground(root.accentColor, model.palette.base) : model.palette.highlight, kcm.accentColor, model.tints, model.tintFactor)
Kirigami.Theme.backgroundColor: kcm.tinted(model.palette.button, kcm.accentColor, model.tints, model.tintFactor)
Kirigami.Theme.textColor: kcm.tinted(model.palette.buttonText, kcm.accentColor, model.tints, model.tintFactor)
activeFocusOnTab: false
......@@ -419,6 +421,7 @@ KCM.GridViewKCM {
// alternative base color we set here.
Kirigami.Theme.inherit: false
Kirigami.Theme.backgroundColor: kcm.tinted(model.palette.base, kcm.accentColor, model.tints, model.tintFactor)
Kirigami.Theme.disabledTextColor: kcm.tinted(model.disabledText, kcm.accentColor, model.tints, model.tintFactor)
Kirigami.Theme.highlightColor: kcm.tinted(root.accentColor ? kcm.accentBackground(root.accentColor, model.palette.base) : model.palette.highlight, kcm.accentColor, model.tints, model.tintFactor)
Kirigami.Theme.highlightedTextColor: kcm.tinted(root.accentColor ? kcm.accentForeground(kcm.accentBackground(root.accentColor, model.palette.base), true) : model.palette.highlightedText, kcm.accentColor, model.tints, model.tintFactor)
Kirigami.Theme.linkColor: kcm.tinted(root.accentColor || model.palette.link, kcm.accentColor, model.tints, model.tintFactor)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment