9import QtQuick.Controls as QQC2
11import QtQuick.Templates as T
13import org.kde.kirigami as Kirigami
29 property string toolTip
35 property alias tile: contentArea.data
42 property bool thumbnailAvailable: false
49 property list<QtObject> actions
55 property alias actionsAnchors: actionsScope.anchors
61 property Item thumbnailArea : contentArea
69 anchors.centerIn: parent
71 ? delegate.width -
Kirigami.Units.gridUnit
72 : Math.min(delegate.GridView.view.implicitCellWidth, delegate.width -
Kirigami.Units.gridUnit)
73 height: Math.min(delegate.GridView.view.implicitCellHeight, delegate.height -
Kirigami.Units.gridUnit)
81 shadow.color:
Qt.rgba(0, 0, 0, 0.3)
90 return Qt.alpha(
Kirigami.Theme.highlightColor, 0.5);
93 return Kirigami.Theme.backgroundColor;
98 duration:
Kirigami.Units.longDuration
99 easing.type: Easing.OutQuad
105 radius:
Kirigami.Units.smallSpacing/2
108 margins:
Kirigami.Units.smallSpacing
111 color:
Kirigami.Theme.backgroundColor
115 parent: thumbnailArea
116 visible: !delegate.thumbnailAvailable
117 anchors.centerIn: parent
118 width:
Kirigami.Units.iconSizes.large
120 source: delegate.text ===
i18nd(
"knewstuff6",
"None") ?
"edit-none" :
"view-preview"
124 anchors.fill: contentArea
125 visible: actionsColumn.children.length > 0
126 opacity:
Kirigami.Settings.isMobile || delegate.hovered || (actionsScope.focus) ? 1 : 0
128 color:
Kirigami.Settings.isMobile ?
"transparent" :
Qt.rgba(1, 1, 1, 0.2)
130 Behavior on opacity {
132 duration:
Kirigami.Units.longDuration
133 easing.type: Easing.OutQuad
142 rightMargin:
Kirigami.Units.smallSpacing
144 topMargin:
Kirigami.Units.smallSpacing
146 width: actionsColumn.width
147 height: actionsColumn.height
153 model: delegate.actions
154 delegate: QQC2.Button {
155 icon.name: modelData.iconName
157 activeFocusOnTab: focus || delegate.focus
158 onClicked: modelData.trigger()
159 enabled: modelData.enabled
160 visible: modelData.visible
162 QQC2.ToolTip.delay: 1000
163 QQC2.ToolTip.timeout: 5000
164 QQC2.ToolTip.visible: (
Kirigami.Settings.isMobile ? pressed : hovered) && modelData.tooltip.length > 0
165 QQC2.ToolTip.text: modelData.tooltip
173 QQC2.ToolTip.delay: 1000
174 QQC2.ToolTip.timeout: 5000
175 QQC2.ToolTip.visible: hovered && delegate.toolTip.length > 0
176 QQC2.ToolTip.text: toolTip
QString i18nd(const char *domain, const char *text, const TYPE &arg...)