// SPDX-FileCopyrightText: 2024 Oliver Beard // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL // // Taken from plasma-welcome's private mocks. import QtQuick import QtQuick.Layouts import org.kde.kirigami as Kirigami import org.kde.plasma.components as PC3 import org.kde.plasma.plasma5support as P5Support MockAppletBase { id: applet implicitWidth: Math.max(timeLabel.width, dateLabel.paintedWidth) + Kirigami.Units.largeSpacing Layout.preferredWidth: implicitWidth P5Support.DataSource { id: timeSource engine: "time" connectedSources: ["Local"] interval: 1000 } PC3.Label { id: timeLabel anchors.top: applet.top anchors.topMargin: 8 anchors.horizontalCenter: applet.horizontalCenter width: paintedWidth height: 15.68 font.pixelSize: 16 text: Qt.formatTime(timeSource.data["Local"]["DateTime"]) verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } PC3.Label { id: dateLabel anchors.top: timeLabel.bottom anchors.horizontalCenter: timeLabel.horizontalCenter width: paintedWidth height: 12.544 font.pixelSize: 13 text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleShortDate) verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } }