// SPDX-FileCopyrightText: 2026 Matvey Shcherbinin // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL import QtQuick import QtQuick.Layouts import QtQuick.Controls as QQC2 import org.kde.kirigami as Kirigami import koutnet.app // not Kirigami.Chip: that one is a control - checkable, closable, focusable - and // this is a label. Not ListSectionHeader either, which puts its text at the leading // edge and its rule after it; a timeline reads down the middle. RowLayout { id: root required property double whenSecs spacing: Kirigami.Units.largeSpacing Kirigami.Separator { Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter } QQC2.Label { id: dateLabel Layout.alignment: Qt.AlignVCenter leftPadding: Kirigami.Units.largeSpacing rightPadding: Kirigami.Units.largeSpacing topPadding: Kirigami.Units.smallSpacing bottomPadding: Kirigami.Units.smallSpacing // RelativeTime.now is read so the newest chip rewrites itself from // "Today" to "Yesterday" at midnight without a message arriving. text: RelativeTime.daySeparator(root.whenSecs, RelativeTime.now) textFormat: Text.PlainText font: Kirigami.Theme.smallFont color: AppPalette.disabledText Accessible.role: Accessible.Heading background: Rectangle { radius: height / 2 color: Kirigami.ColorUtils.tintWithAlpha(ThemePalette.surface, ThemePalette.text, 0.07) } } Kirigami.Separator { Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter } }