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
20 readonly property bool showSeparator: root.index !== ListView.view.count
22 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
23 implicitContentWidth + leftPadding + rightPadding,
24 implicitIndicatorWidth + leftPadding + rightPadding)
25 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
26 implicitContentHeight + topPadding + bottomPadding,
27 implicitIndicatorHeight + topPadding + bottomPadding,
28 Kirigami.Units.gridUnit * 2)
30 width: ListView.view ? ListView.view.width : implicitWidth
31 highlighted: ListView.isCurrentItem
33 padding: Kirigami.Units.largeSpacing
35 horizontalPadding: padding
36 leftPadding: horizontalPadding
37 rightPadding: horizontalPadding
39 verticalPadding: padding
40 topPadding: verticalPadding
41 bottomPadding: verticalPadding
46 width: if (contentItem instanceof SubtitleContentItem) {
47 Kirigami.Units.iconSizes.large
49 Kirigami.Units.iconSizes.medium
52 height: if (contentItem instanceof SubtitleContentItem) {
53 Kirigami.Units.iconSizes.large
55 Kirigami.Units.iconSizes.medium
59 Accessible.description: if (contentItem instanceof SubtitleContentItem) {
65 background: Rectangle {
66 color: if (root.highlighted || root.checked || (root.down && !root.checked) || root.visualFocus) {
67 const highlight = Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, Kirigami.Theme.highlightColor, 0.3);
69 Kirigami.ColorUtils.tintWithAlpha(highlight, Kirigami.Theme.textColor, 0.10)
73 } else if (root.hovered) {
74 Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, Kirigami.Theme.textColor, 0.10)
76 Kirigami.Theme.backgroundColor
91 color: Kirigami.Theme.highlightColor
99 leftMargin: root.leftPadding
100 rightMargin: root.rightPadding
102 visible: root.showSeparator && !root.hovered && (root.index === 0 || !root.ListView.view.itemAtIndex(root.index - 1))
107 contentItem: DefaultContentItem {