2022-06-08 22:09:35 +00:00
|
|
|
// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
|
|
2023-03-05 02:40:06 +00:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Controls
|
2022-06-08 22:09:35 +00:00
|
|
|
|
2023-03-08 13:26:36 +00:00
|
|
|
import org.kde.plasma.plasma5support 2.0 as P5Support
|
2023-07-25 01:13:52 +00:00
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
2022-06-08 22:09:35 +00:00
|
|
|
|
2023-03-05 02:40:06 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2022-06-08 22:09:35 +00:00
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
|
|
|
|
|
readonly property bool is24HourTime: MobileShell.ShellUtil.isSystem24HourFormat
|
|
|
|
|
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
text: Qt.formatTime(timeSource.data["Local"]["DateTime"], root.is24HourTime ? "h:mm" : "h:mm ap")
|
|
|
|
|
color: "white"
|
|
|
|
|
style: softwareRendering ? Text.Outline : Text.Normal
|
|
|
|
|
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter
|
|
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
2023-05-12 23:43:49 +00:00
|
|
|
|
2022-06-08 22:09:35 +00:00
|
|
|
font.weight: Font.Bold // this font weight may switch to regular on distros that don't have a light variant
|
|
|
|
|
font.pointSize: 28
|
2023-05-12 23:43:49 +00:00
|
|
|
|
2022-06-08 22:09:35 +00:00
|
|
|
layer.enabled: true
|
2023-05-12 23:43:49 +00:00
|
|
|
layer.effect: MobileShell.TextDropShadow {}
|
2022-06-08 22:09:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
2023-07-25 01:13:52 +00:00
|
|
|
Layout.topMargin: Kirigami.Units.smallSpacing
|
2022-06-08 22:09:35 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
|
text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "ddd, MMM d")
|
|
|
|
|
color: "white"
|
|
|
|
|
style: softwareRendering ? Text.Outline : Text.Normal
|
|
|
|
|
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter
|
|
|
|
|
|
|
|
|
|
font.pointSize: 12
|
2023-05-12 23:43:49 +00:00
|
|
|
|
2022-06-08 22:09:35 +00:00
|
|
|
layer.enabled: true
|
2023-05-12 23:43:49 +00:00
|
|
|
layer.effect: MobileShell.TextDropShadow {}
|
2022-06-08 22:09:35 +00:00
|
|
|
}
|
|
|
|
|
|
2023-03-08 13:26:36 +00:00
|
|
|
P5Support.DataSource {
|
2022-06-08 22:09:35 +00:00
|
|
|
id: timeSource
|
|
|
|
|
engine: "time"
|
|
|
|
|
connectedSources: ["Local"]
|
2023-04-23 20:24:47 +00:00
|
|
|
interval: 60000
|
|
|
|
|
intervalAlignment: P5Support.Types.AlignToMinute
|
2022-06-08 22:09:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|