diff --git a/lookandfeel/contents/components/Clock.qml b/lookandfeel/contents/components/Clock.qml --- a/lookandfeel/contents/components/Clock.qml +++ b/lookandfeel/contents/components/Clock.qml @@ -19,53 +19,31 @@ import QtQuick 2.8 import QtQuick.Layouts 1.1 -import QtGraphicalEffects 1.0 import org.kde.plasma.core 2.0 import org.kde.plasma.components 2.0 -Item { - // If we're using software rendering, draw outlines instead of shadows - // See https://bugs.kde.org/show_bug.cgi?id=398317 +ColumnLayout { readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software - width: clock.implicitWidth - height: clock.implicitHeight - - DropShadow { - id: clockShadow - visible: !softwareRendering - anchors.fill: clock - source: clock - horizontalOffset: 1 - verticalOffset: 1 - radius: 6 - samples: 14 - spread: 0.3 - color: "black" // matches Breeze window decoration and desktopcontainment + Label { + text: Qt.formatTime(timeSource.data["Local"]["DateTime"]) + style: softwareRendering ? Text.Outline : Text.Normal + styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter + font.pointSize: 48 + Layout.alignment: Qt.AlignHCenter } - - ColumnLayout { - id: clock - Label { - text: Qt.formatTime(timeSource.data["Local"]["DateTime"]) - 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 : Text.Normal - styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter - font.pointSize: 24 - Layout.alignment: Qt.AlignHCenter - } - DataSource { - id: timeSource - engine: "time" - connectedSources: ["Local"] - interval: 1000 - } + Label { + text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate) + style: softwareRendering ? Text.Outline : Text.Normal + styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter + font.pointSize: 24 + Layout.alignment: Qt.AlignHCenter + } + DataSource { + id: timeSource + engine: "time" + connectedSources: ["Local"] + interval: 1000 } } diff --git a/lookandfeel/contents/components/UserDelegate.qml b/lookandfeel/contents/components/UserDelegate.qml --- a/lookandfeel/contents/components/UserDelegate.qml +++ b/lookandfeel/contents/components/UserDelegate.qml @@ -19,8 +19,6 @@ */ import QtQuick 2.8 -import QtGraphicalEffects 1.0 - import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents @@ -159,19 +157,6 @@ " } - DropShadow { - id: usernameShadow - visible: !softwareRendering - anchors.fill: usernameDelegate - source: usernameDelegate - horizontalOffset: 1 - verticalOffset: 1 - radius: 4 - samples: 9 - spread: 0.35 - color: "black" // matches Breeze window decoration and desktopcontainment - } - PlasmaComponents.Label { id: usernameDelegate font.pointSize: theme.defaultFont.pointSize + 2 diff --git a/lookandfeel/contents/lockscreen/LockScreenUi.qml b/lookandfeel/contents/lockscreen/LockScreenUi.qml --- a/lookandfeel/contents/lockscreen/LockScreenUi.qml +++ b/lookandfeel/contents/lockscreen/LockScreenUi.qml @@ -17,7 +17,7 @@ along with this program. If not, see . *********************************************************************/ -import QtQuick 2.6 +import QtQuick 2.8 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 import QtGraphicalEffects 1.0 @@ -30,6 +30,10 @@ 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 + colorGroup: PlasmaCore.Theme.ComplementaryColorGroup Connections { @@ -161,6 +165,25 @@ clock: clock } + DropShadow { + id: clockShadow + anchors.fill: clock + source: clock + visible: !softwareRendering + horizontalOffset: 1 + verticalOffset: 1 + radius: 6 + samples: 14 + spread: 0.3 + color: "black" // matches Breeze window decoration and desktopcontainment + Behavior on opacity { + OpacityAnimator { + duration: 1000 + easing.type: Easing.InOutQuad + } + } + } + Clock { id: clock property Item shadow: clockShadow @@ -269,7 +292,7 @@ state = "hidden"; } } - + states: [ State { name: "visible" diff --git a/sddm-theme/Main.qml b/sddm-theme/Main.qml --- a/sddm-theme/Main.qml +++ b/sddm-theme/Main.qml @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import QtQuick 2.2 +import QtQuick 2.8 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.1 @@ -31,6 +31,11 @@ PlasmaCore.ColorScope { id: root + + // 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 + colorGroup: PlasmaCore.Theme.ComplementaryColorGroup width: 1600 @@ -115,9 +120,29 @@ clock: clock } + DropShadow { + id: clockShadow + anchors.fill: clock + source: clock + visible: !softwareRendering + horizontalOffset: 1 + verticalOffset: 1 + radius: 6 + samples: 14 + spread: 0.3 + color: "black" // matches Breeze window decoration and desktopcontainment + Behavior on opacity { + OpacityAnimator { + duration: 1000 + easing.type: Easing.InOutQuad + } + } + } + Clock { id: clock visible: y > 0 + property Item shadow: clockShadow y: (userListComponent.userList.y + mainStack.y)/2 - height/2 anchors.horizontalCenter: parent.horizontalCenter }