From 06793f21d1ced7eb45c3d948dbfa7c26aa5222ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kre=C5=A1imir=20=C4=8Cohar?= Date: Thu, 7 Mar 2019 07:56:23 +0100 Subject: [PATCH] [sddm-theme/lock screen] Fix "unable to assign [undefined]" error Summary: This patch fixes the "Unable to assign [undefined] to QColor" and "Unable to assign [undefined] to int" errors that occur in UserDelegate.qml (188:9, 187:9) and Clock.qml (53:13, 52:13, 60:13, 59:13), visible in sddm-greeter's output. It does so by resetting the label style to Normal (instead of undefined). Once Text.Normal is set, the outline color is set as transparent (but that doesn't matter since there's no outline to begin with). Test Plan: Works the same, looks the same, no error in output. Reviewers: #vdg, #plasma, broulik Reviewed By: #plasma, broulik Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D19577 --- lookandfeel/contents/components/Clock.qml | 10 +++++----- lookandfeel/contents/components/UserDelegate.qml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lookandfeel/contents/components/Clock.qml b/lookandfeel/contents/components/Clock.qml index 6623c96c1..149f9ec65 100644 --- a/lookandfeel/contents/components/Clock.qml +++ b/lookandfeel/contents/components/Clock.qml @@ -44,20 +44,20 @@ Item { spread: 0.3 color: "black" // matches Breeze window decoration and desktopcontainment } - + ColumnLayout { id: clock Label { text: Qt.formatTime(timeSource.data["Local"]["DateTime"]) - style: softwareRendering ? Text.Outline : undefined - styleColor: softwareRendering ? ColorScope.backgroundColor : undefined + style: softwareRendering ? Text.Outline : Text.Normal + styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter font.pointSize: 48 Layout.alignment: Qt.AlignHCenter } Label { text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate) - style: softwareRendering ? Text.Outline : undefined - styleColor: softwareRendering ? ColorScope.backgroundColor : undefined + style: softwareRendering ? Text.Outline : Text.Normal + styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter font.pointSize: 24 Layout.alignment: Qt.AlignHCenter } diff --git a/lookandfeel/contents/components/UserDelegate.qml b/lookandfeel/contents/components/UserDelegate.qml index 9e563323b..e0439b018 100644 --- a/lookandfeel/contents/components/UserDelegate.qml +++ b/lookandfeel/contents/components/UserDelegate.qml @@ -183,8 +183,8 @@ Item { height: implicitHeight // work around stupid bug in Plasma Components that sets the height width: constrainText ? parent.width : implicitWidth text: wrapper.name - style: softwareRendering ? Text.Outline : undefined - styleColor: softwareRendering ? ColorScope.backgroundColor : undefined + style: softwareRendering ? Text.Outline : Text.Normal + styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter //make an indication that this has active focus, this only happens when reached with keyboard navigation