shift-shell/components/mobileshell/qml/statusbar/ClockText.qml
Marco Martin acd8605a4f Port dataengine usage to plasma5support
DataEngines are deprecated and are being splitted in a (temporary lived)
compat library called plasma5support
2023-03-08 14:26:36 +01:00

34 lines
898 B
QML

/*
* SPDX-FileCopyrightText: 2021 Devin Lin <espidev@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.12
import QtQuick.Layouts 1.15
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasma5support 2.0 as P5Support
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import "indicators" as Indicators
PlasmaComponents.Label {
id: clock
required property P5Support.DataSource source
property bool is24HourTime: MobileShell.ShellUtil.isSystem24HourFormat
text: Qt.formatTime(source.data.Local.DateTime, is24HourTime ? "h:mm" : "h:mm ap")
color: PlasmaCore.ColorScope.textColor
verticalAlignment: Qt.AlignVCenter
TapHandler {
onTapped: {
MobileShell.ShellUtil.launchApp("org.kde.kclock.desktop");
}
}
}