From a31e4ce4ec4c0a7083b9bdfa962dafec4ac8f784 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Thu, 17 Feb 2022 11:11:23 -0700 Subject: [PATCH] Lock/login themes: stop adjusting shadows based on color scheme Right now we change the intensity of shadows based on the color scheme's text color, but with a property called "lightBackground". This indicates that we wanted to do it based on the background color itself, but did not or could not, so settled on using the text color as a proxy. However this is wrong; there is no relationship between the active color scheme's text color and the color of the background image. Even if we could or did fix that, it would probably still be wrong, because using lighter shadows on a genuinely light background would result in worse contrast and readability, especially if the light background was very visually busy. For these reasons, in most other places, we have since settled on the mantra of "shadows should be black", and this commit makes the lock and login screens follow that convention as well. BUG: 449985 FIXED-IN: 5.24.2 (cherry picked from commit 146ef22fcbdaf8bc4648e1fb29a6415a524f83dd) --- lookandfeel/contents/lockscreen/LockScreenUi.qml | 8 +------- sddm-theme/Main.qml | 15 ++------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/lookandfeel/contents/lockscreen/LockScreenUi.qml b/lookandfeel/contents/lockscreen/LockScreenUi.qml index 25b7b2d92..3fa056038 100644 --- a/lookandfeel/contents/lockscreen/LockScreenUi.qml +++ b/lookandfeel/contents/lockscreen/LockScreenUi.qml @@ -22,7 +22,6 @@ PlasmaCore.ColorScope { // If we're using software rendering, draw outlines instead of shadows // See https://bugs.kde.org/show_bug.cgi?id=398317 readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software - readonly property bool lightBackground: Math.max(PlasmaCore.ColorScope.backgroundColor.r, PlasmaCore.ColorScope.backgroundColor.g, PlasmaCore.ColorScope.backgroundColor.b) > 0.5 colorGroup: PlasmaCore.Theme.ComplementaryColorGroup @@ -179,12 +178,7 @@ PlasmaCore.ColorScope { radius: 6 samples: 14 spread: 0.3 - // Soften the color a bit so it doesn't look so stark against light backgrounds - color: lockScreenUi.lightBackground ? Qt.rgba(PlasmaCore.ColorScope.backgroundColor.r, - PlasmaCore.ColorScope.backgroundColor.g, - PlasmaCore.ColorScope.backgroundColor.b, - 0.6) - : "black" // black matches Breeze window decoration and desktopcontainment + color : "black" // shadows should always be black Behavior on opacity { OpacityAnimator { duration: PlasmaCore.Units.veryLongDuration * 2 diff --git a/sddm-theme/Main.qml b/sddm-theme/Main.qml index 733108504..00e3cd904 100644 --- a/sddm-theme/Main.qml +++ b/sddm-theme/Main.qml @@ -30,7 +30,6 @@ PlasmaCore.ColorScope { readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software colorGroup: PlasmaCore.Theme.ComplementaryColorGroup - readonly property bool lightBackground: Math.max(PlasmaCore.ColorScope.backgroundColor.r, PlasmaCore.ColorScope.backgroundColor.g, PlasmaCore.ColorScope.backgroundColor.b) > 0.5 width: 1600 height: 900 @@ -124,12 +123,7 @@ PlasmaCore.ColorScope { radius: 6 samples: 14 spread: 0.3 - // Soften the color a bit so it doesn't look so stark against light backgrounds - color: root.lightBackground ? Qt.rgba(PlasmaCore.ColorScope.backgroundColor.r, - PlasmaCore.ColorScope.backgroundColor.g, - PlasmaCore.ColorScope.backgroundColor.b, - 0.6) - : "black" // black matches Breeze window decoration and desktopcontainment + color : "black" // shadows should always be black Behavior on opacity { OpacityAnimator { duration: PlasmaCore.Units.veryLongDuration * 2 @@ -503,12 +497,7 @@ PlasmaCore.ColorScope { radius: 6 samples: 14 spread: 0.3 - // Soften the color a bit so it doesn't look so stark against light backgrounds - color: root.lightBackground ? Qt.rgba(PlasmaCore.ColorScope.backgroundColor.r, - PlasmaCore.ColorScope.backgroundColor.g, - PlasmaCore.ColorScope.backgroundColor.b, - 0.6) - : "black" // black matches Breeze window decoration and desktopcontainment + color : "black" // shadows should always be black opacity: loginScreenRoot.uiVisible ? 0 : 1 Behavior on opacity { //OpacityAnimator when starting from 0 is buggy (it shows one frame with opacity 1)"