Warning, /plasma/plasma-mobile/look-and-feel/contents/lockscreen/Clock.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de>
0003  * SPDX-FileCopyrightText: 2020-2022 Devin Lin <devin@kde.org>
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 import QtQuick 2.15
0008 import QtQuick.Layouts 1.15
0009 import QtQuick.Controls 2.15
0010 import QtGraphicalEffects 1.12
0011 
0012 import org.kde.plasma.core 2.0 as PlasmaCore
0013 import org.kde.plasma.components 3.0 as PC3
0014 import org.kde.plasma.private.mobileshell 1.0 as MobileShell
0015 
0016 Item {
0017     id: root
0018     implicitHeight: clockColumn.implicitHeight
0019     implicitWidth: clockColumn.implicitWidth
0020     
0021     property int layoutAlignment
0022     
0023     PlasmaCore.DataSource {
0024         id: timeSource
0025         engine: "time"
0026         connectedSources: ["Local"]
0027         interval: 60000
0028         intervalAlignment: PlasmaCore.Types.AlignToMinute
0029     }
0030     
0031     DropShadow {
0032         anchors.fill: parent
0033         source: clockColumn
0034         cached: true
0035         verticalOffset: 1
0036         radius: 4
0037         samples: 6
0038         color: Qt.rgba(0, 0, 0, 0.4)
0039     }
0040     
0041     ColumnLayout {
0042         id: clockColumn
0043         opacity: 0.8
0044         spacing: PlasmaCore.Units.gridUnit
0045         
0046         anchors.top: parent.top
0047         anchors.left: parent.left
0048         anchors.right: parent.right
0049         
0050         PC3.Label {
0051             text: Qt.formatTime(timeSource.data["Local"]["DateTime"], MobileShell.ShellUtil.isSystem24HourFormat ? "h:mm" : "h:mm ap")
0052             color: "white"
0053             
0054             Layout.alignment: root.layoutAlignment
0055             font.weight: Font.Bold
0056             font.pointSize: 36
0057         }
0058         
0059         PC3.Label {
0060             text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "ddd, MMM d")
0061             color: "white"
0062             
0063             Layout.alignment: root.layoutAlignment
0064             font.weight: Font.Bold
0065             font.pointSize: 10
0066         }
0067     }
0068 }