2021-12-22 23:29:00 +00:00
|
|
|
/*
|
|
|
|
|
* 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
|
|
|
|
|
|
2025-11-12 21:20:11 +00:00
|
|
|
import org.kde.plasma.clock
|
2021-12-22 23:29:00 +00:00
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2024-06-28 02:05:42 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2023-07-25 02:24:10 +00:00
|
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
|
|
2024-06-28 02:05:42 +00:00
|
|
|
RowLayout {
|
|
|
|
|
id: clockText
|
|
|
|
|
|
|
|
|
|
required property int fontPixelSize
|
2025-11-12 21:20:11 +00:00
|
|
|
required property Clock clockSource
|
2024-06-28 02:05:42 +00:00
|
|
|
|
|
|
|
|
PlasmaComponents.Label {
|
|
|
|
|
id: clock
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2024-06-28 02:05:42 +00:00
|
|
|
property bool is24HourTime: MobileShell.ShellUtil.isSystem24HourFormat
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2025-11-12 21:20:11 +00:00
|
|
|
text: Qt.formatTime(clockSource.dateTime, is24HourTime ? "h:mm" : "h:mm ap")
|
2024-06-28 02:05:42 +00:00
|
|
|
color: Kirigami.Theme.textColor
|
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
|
font.pixelSize: fontPixelSize
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PlasmaComponents.Label {
|
|
|
|
|
id: date
|
|
|
|
|
visible: ShellSettings.Settings.dateInStatusBar && !root.showSecondRow
|
|
|
|
|
|
2025-11-12 21:20:11 +00:00
|
|
|
text: Qt.formatDate(clockSource.dateTime, "ddd. MMMM d")
|
2024-06-28 02:05:42 +00:00
|
|
|
color: Kirigami.Theme.textColor
|
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
|
font.pixelSize: fontPixelSize
|
|
|
|
|
}
|
2021-12-22 23:29:00 +00:00
|
|
|
}
|