2020-08-31 01:38:46 +00:00
|
|
|
/*
|
2022-02-17 05:52:34 +00:00
|
|
|
* SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de>
|
2022-10-27 23:48:05 +00:00
|
|
|
* SPDX-FileCopyrightText: 2020-2022 Devin Lin <devin@kde.org>
|
2022-02-17 05:52:34 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2020-08-31 01:38:46 +00:00
|
|
|
*/
|
|
|
|
|
|
2022-10-27 23:48:05 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
import QtQuick.Controls 2.15
|
2021-12-24 15:51:21 +00:00
|
|
|
|
2023-07-25 01:13:52 +00:00
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
2023-03-08 13:26:36 +00:00
|
|
|
import org.kde.plasma.plasma5support 2.0 as P5Support
|
2022-10-27 23:48:05 +00:00
|
|
|
import org.kde.plasma.components 3.0 as PC3
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2022-04-07 14:35:35 +00:00
|
|
|
|
2022-10-27 23:48:05 +00:00
|
|
|
Item {
|
2022-02-17 05:52:34 +00:00
|
|
|
id: root
|
2022-10-27 23:48:05 +00:00
|
|
|
implicitHeight: clockColumn.implicitHeight
|
|
|
|
|
implicitWidth: clockColumn.implicitWidth
|
|
|
|
|
|
2022-02-17 05:52:34 +00:00
|
|
|
property int layoutAlignment
|
|
|
|
|
|
2023-03-08 13:26:36 +00:00
|
|
|
P5Support.DataSource {
|
2022-10-27 23:48:05 +00:00
|
|
|
id: timeSource
|
|
|
|
|
engine: "time"
|
|
|
|
|
connectedSources: ["Local"]
|
|
|
|
|
interval: 60000
|
2023-03-09 15:45:30 +00:00
|
|
|
intervalAlignment: P5Support.Types.AlignToMinute
|
2022-10-27 23:48:05 +00:00
|
|
|
}
|
2020-08-31 01:38:46 +00:00
|
|
|
|
2022-10-27 23:48:05 +00:00
|
|
|
ColumnLayout {
|
|
|
|
|
id: clockColumn
|
2023-07-25 01:13:52 +00:00
|
|
|
spacing: Kirigami.Units.gridUnit
|
2022-10-27 23:48:05 +00:00
|
|
|
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
2020-08-31 01:38:46 +00:00
|
|
|
|
2022-10-27 23:48:05 +00:00
|
|
|
PC3.Label {
|
|
|
|
|
text: Qt.formatTime(timeSource.data["Local"]["DateTime"], MobileShell.ShellUtil.isSystem24HourFormat ? "h:mm" : "h:mm ap")
|
|
|
|
|
color: "white"
|
|
|
|
|
|
|
|
|
|
Layout.alignment: root.layoutAlignment
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
font.pointSize: 36
|
2023-05-13 15:15:52 +00:00
|
|
|
|
|
|
|
|
layer.enabled: true
|
|
|
|
|
layer.effect: MobileShell.TextDropShadow {
|
|
|
|
|
blurMax: 16
|
|
|
|
|
}
|
2022-10-27 23:48:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PC3.Label {
|
|
|
|
|
text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "ddd, MMM d")
|
|
|
|
|
color: "white"
|
|
|
|
|
|
|
|
|
|
Layout.alignment: root.layoutAlignment
|
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
font.pointSize: 10
|
2023-05-13 15:15:52 +00:00
|
|
|
|
|
|
|
|
layer.enabled: true
|
|
|
|
|
layer.effect: MobileShell.TextDropShadow {
|
|
|
|
|
blurMax: 16
|
|
|
|
|
}
|
2020-08-31 01:38:46 +00:00
|
|
|
}
|
2020-02-01 14:21:24 +00:00
|
|
|
}
|
|
|
|
|
}
|