6import org.kde.kirigami as Kirigami
7import QtQuick.Controls as QQC2
8import QtQuick.Templates as T
17 required property int index
18 required property bool unread
23 property ListView listView: ListView.view
25 readonly property bool showSeparator: root.index !== listView.count
27 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
28 implicitContentWidth + leftPadding + rightPadding,
29 implicitIndicatorWidth + leftPadding + rightPadding)
30 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
31 implicitContentHeight + topPadding + bottomPadding,
32 implicitIndicatorHeight + topPadding + bottomPadding,
33 Kirigami.Units.gridUnit * 2)
35 width: listView ? listView.width : implicitWidth
36 highlighted: ListView.isCurrentItem
38 padding: Kirigami.Units.largeSpacing
40 horizontalPadding: padding
41 leftPadding: horizontalPadding
42 rightPadding: horizontalPadding
44 verticalPadding: padding
45 topPadding: verticalPadding
46 bottomPadding: verticalPadding
51 width: if (contentItem instanceof SubtitleContentItem) {
52 Kirigami.Units.iconSizes.large
54 Kirigami.Units.iconSizes.medium
57 height: if (contentItem instanceof SubtitleContentItem) {
58 Kirigami.Units.iconSizes.large
60 Kirigami.Units.iconSizes.medium
64 Accessible.description: if (contentItem instanceof SubtitleContentItem) {
70 background: Rectangle {
71 color: if (root.highlighted || root.checked || (root.down && !root.checked) || root.visualFocus) {
72 const highlight = Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, Kirigami.Theme.highlightColor, 0.3);
74 Kirigami.ColorUtils.tintWithAlpha(highlight, Kirigami.Theme.textColor, 0.10)
78 } else if (root.hovered) {
79 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, Kirigami.Theme.textColor, 0.10)
81 Kirigami.Theme.backgroundColor
96 color: Kirigami.Theme.highlightColor
101 bottom: parent.bottom
104 leftMargin: root.leftPadding
105 rightMargin: root.rightPadding
107 visible: root.showSeparator && !root.hovered
112 contentItem: DefaultContentItem {