shift-shell/look-and-feel/contents/lockscreen/Clock.qml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.8 KiB
QML
Raw Normal View History

2020-08-31 01:38:46 +00:00
/*
2021-03-01 20:03:25 +00:00
SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de>
2020-08-31 01:38:46 +00:00
2021-03-01 20:03:25 +00:00
SPDX-License-Identifier: GPL-2.0-or-later
2020-08-31 01:38:46 +00:00
*/
2020-02-01 14:21:24 +00:00
import QtQuick 2.8
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.5
2020-08-31 01:38:46 +00:00
import QtGraphicalEffects 1.12
2020-02-01 14:21:24 +00:00
import org.kde.plasma.core 2.0
ColumnLayout {
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
2020-08-31 01:38:46 +00:00
property int alignment
Layout.alignment: alignment
2021-09-13 16:40:56 +00:00
spacing: Units.gridUnit
2020-08-31 01:38:46 +00:00
2020-02-01 14:21:24 +00:00
Label {
text: Qt.formatTime(timeSource.data["Local"]["DateTime"], root.is24HourTime ? "h:mm" : "h:mm ap")
2020-02-01 14:21:24 +00:00
color: ColorScope.textColor
style: softwareRendering ? Text.Outline : Text.Normal
2020-08-31 01:38:46 +00:00
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter
Layout.alignment: alignment
font.weight: Font.Light // this font weight may switch to regular on distros that don't have a light variant
font.pointSize: 36
layer.enabled: true
layer.effect: DropShadow {
verticalOffset: 1
radius: 4
samples: 6
color: "#757575"
}
2020-02-01 14:21:24 +00:00
}
Label {
2020-08-31 01:38:46 +00:00
text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "ddd, MMM d")
2020-02-01 14:21:24 +00:00
color: ColorScope.textColor
style: softwareRendering ? Text.Outline : Text.Normal
2020-08-31 01:38:46 +00:00
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter
Layout.alignment: alignment
font.pointSize: 10
layer.enabled: true
layer.effect: DropShadow {
verticalOffset: 1
radius: 4
samples: 6
color: "#757575"
}
2020-02-01 14:21:24 +00:00
}
DataSource {
id: timeSource
engine: "time"
connectedSources: ["Local"]
interval: 1000
}
}