Commit 33f31fb7 authored by Filip Fila's avatar Filip Fila 🌆
Browse files

[ResultDelegate] Fix bad text legiblity with certain 3rd party themes

Summary:
This is a fix for D25043.

Using `disabledTextColor` results in bad text legibility with Plasma themes that use filled-style highlight effects.

If colors are prefered over opacity as means of achieving text shading then we need to mix `disabledTextColor` with `textColor` on selection.

This creates an effect that is comparable to the `opacity: isCurrent? 0.8 : 0.6` code that is used throughout Plasma for subtitles.

Test Plan:
Only test with master.

Arc Color (before):
{F7770216}

Arc Color (after):
{F7770217}

McMojave (before):
{F7770218}

McMojave (after):
{F7770219}

Breeze (before):
{F7770215}

Breeze (after):
{F7770221}

Breeze Dark (before):
{F7770222}

Breeze Dark (after):
{F7770223}

Reviewers: #plasma, #vdg, ngraham, broulik

Reviewed By: #plasma, #vdg, ngraham, broulik

Subscribers: ngraham, broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D25374
parent dfecda35
...@@ -147,7 +147,7 @@ MouseArea { ...@@ -147,7 +147,7 @@ MouseArea {
PlasmaComponents.Label { PlasmaComponents.Label {
id: typeText id: typeText
text: resultDelegate.typeText text: resultDelegate.typeText
color: theme.disabledTextColor color: isCurrent ? Qt.tint(theme.disabledTextColor, Qt.rgba(theme.textColor.r, theme.textColor.g, theme.textColor.b, 0.4)) : theme.disabledTextColor
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
...@@ -224,7 +224,7 @@ MouseArea { ...@@ -224,7 +224,7 @@ MouseArea {
// but still render the text leading to it overlapping the action buttons looking horrible // but still render the text leading to it overlapping the action buttons looking horrible
opacity: width > 0 ? 1 : 0 opacity: width > 0 ? 1 : 0
color: theme.disabledTextColor color: isCurrent ? Qt.tint(theme.disabledTextColor, Qt.rgba(theme.textColor.r, theme.textColor.g, theme.textColor.b, 0.4)) : theme.disabledTextColor
height: undefined height: undefined
......
Markdown is supported
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