6import QtQuick.Controls as QQC2
7import QtQuick.Templates as T
8import org.kde.kirigami as Kirigami
25 property var listView: ListView
33 property var gridView: GridView
41 property bool dropAreaHovered: false
43 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
44 implicitContentWidth + leftPadding + rightPadding,
45 implicitIndicatorWidth + leftPadding + rightPadding)
46 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
47 implicitContentHeight + topPadding + bottomPadding,
48 implicitIndicatorHeight + topPadding + bottomPadding,
49 Kirigami.Units.gridUnit * 2)
51 width: if (listView.view) {
52 return listView.view.width;
53 }
else if (gridView.view) {
54 return gridView.view.cellWidth;
59 height:
if (gridView.view) {
60 return gridView.view.cellHeight;
62 return implicitHeight;
64 highlighted: listView.isCurrentItem || gridView.isCurrentItem
66 spacing:
Kirigami.Units.mediumSpacing
68 padding:
Kirigami.Units.mediumSpacing
70 horizontalPadding: padding + Math.round(
Kirigami.Units.smallSpacing / 2)
71 leftPadding: horizontalPadding
72 rightPadding: horizontalPadding
74 verticalPadding: padding
75 topPadding: verticalPadding
76 bottomPadding: verticalPadding
80 topInset:
if (root.index !== undefined && index === 0 && listView.view && listView.view.topMargin === 0) {
83 Math.round(
Kirigami.Units.smallSpacing / 2);
85 bottomInset:
if (root.index !== undefined && listView.view && index === listView.view.count - 1 && listView.view.bottomMargin === 0) {
88 Math.round(
Kirigami.Units.smallSpacing / 2)
90 rightInset:
Kirigami.Units.smallSpacing
91 leftInset:
Kirigami.Units.smallSpacing
94 width:
if (contentItem instanceof SubtitleContentItem) {
97 Kirigami.Units.iconSizes.sizeForLabels
100 height:
if (contentItem instanceof SubtitleContentItem) {
103 Kirigami.Units.iconSizes.sizeForLabels
107 Accessible.description:
if (contentItem instanceof SubtitleContentItem) {
113 background: Rectangle {
116 color:
if (root.highlighted || root.checked || (root.down && !root.checked) || root.visualFocus) {
117 const highlight =
Kirigami.ColorUtils.tintWithAlpha(
Kirigami.Theme.backgroundColor,
Kirigami.Theme.highlightColor, 0.3);
118 if (root.hovered || root.dropAreaHovered) {
119 Kirigami.ColorUtils.tintWithAlpha(highlight,
Kirigami.Theme.textColor, 0.10)
123 }
else if (root.hovered || root.dropAreaHovered) {
130 color:
Kirigami.Theme.highlightColor
131 width: root.visualFocus || root.activeFocus ? 1 : 0
136 duration:
Kirigami.Units.shortDuration
Content item which is used by default in the RoundedItemDelegate and IndicatorItemDelegate.