Warning, /plasma/plasma-mobile/containments/homescreens/halcyon/package/contents/ui/Clock.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
0002 // SPDX-License-Identifier: LGPL-2.1-or-later
0003
0004 import QtQuick
0005 import QtQuick.Layouts
0006 import QtQuick.Controls
0007
0008 import org.kde.plasma.plasma5support 2.0 as P5Support
0009 import org.kde.kirigami 2.20 as Kirigami
0010
0011 import org.kde.plasma.private.mobileshell as MobileShell
0012
0013 ColumnLayout {
0014 id: root
0015
0016 readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
0017 readonly property bool is24HourTime: MobileShell.ShellUtil.isSystem24HourFormat
0018
0019 spacing: 0
0020
0021 Label {
0022 text: Qt.formatTime(timeSource.data["Local"]["DateTime"], root.is24HourTime ? "h:mm" : "h:mm ap")
0023 color: "white"
0024 style: softwareRendering ? Text.Outline : Text.Normal
0025 styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter
0026
0027 Layout.fillWidth: true
0028
0029 horizontalAlignment: Text.AlignLeft
0030
0031 font.weight: Font.Bold // this font weight may switch to regular on distros that don't have a light variant
0032 font.pointSize: 28
0033
0034 layer.enabled: true
0035 layer.effect: MobileShell.TextDropShadow {}
0036 }
0037
0038 Label {
0039 Layout.topMargin: Kirigami.Units.smallSpacing
0040 Layout.fillWidth: true
0041
0042 horizontalAlignment: Text.AlignLeft
0043 text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "ddd, MMM d")
0044 color: "white"
0045 style: softwareRendering ? Text.Outline : Text.Normal
0046 styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter
0047
0048 font.pointSize: 12
0049
0050 layer.enabled: true
0051 layer.effect: MobileShell.TextDropShadow {}
0052 }
0053
0054 P5Support.DataSource {
0055 id: timeSource
0056 engine: "time"
0057 connectedSources: ["Local"]
0058 interval: 60000
0059 intervalAlignment: P5Support.Types.AlignToMinute
0060 }
0061
0062 }