shift-shell/containments/homescreens/halcyon/qml/Clock.qml
Devin Lin a8b858dc3e Remove kirigami version in imports
This fixes potential issues stemming from pinning versions on Kirigami
qml api imports
2026-03-06 22:08:07 -05:00

58 lines
1.6 KiB
QML

// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: LGPL-2.1-or-later
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import org.kde.plasma.clock
import org.kde.kirigami as Kirigami
import org.kde.plasma.private.mobileshell as MobileShell
ColumnLayout {
id: root
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
readonly property bool is24HourTime: MobileShell.ShellUtil.isSystem24HourFormat
spacing: 0
Label {
text: Qt.formatTime(clockSource.dateTime, root.is24HourTime ? "h:mm" : "h:mm ap")
color: "white"
style: softwareRendering ? Text.Outline : Text.Normal
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter
Layout.fillWidth: true
horizontalAlignment: Text.AlignLeft
font.weight: Font.Bold // this font weight may switch to regular on distros that don't have a light variant
font.pointSize: 28
layer.enabled: true
layer.effect: MobileShell.TextDropShadow {}
}
Label {
Layout.topMargin: Kirigami.Units.smallSpacing
Layout.fillWidth: true
horizontalAlignment: Text.AlignLeft
text: Qt.formatDate(clockSource.dateTime, "ddd, MMM d")
color: "white"
style: softwareRendering ? Text.Outline : Text.Normal
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter
font.pointSize: 12
layer.enabled: true
layer.effect: MobileShell.TextDropShadow {}
}
Clock {
id: clockSource
}
}