/*SPDX-FileCopyrightText: 2015 Eike Hein <hein@kde.org>SPDX-License-Identifier: GPL-2.0-or-later*/pragma ComponentBehavior: Boundimport QtQuickimport QtQuick.Layoutsimport org.kde.kirigami as Kirigamiimport org.kde.ksvg as KSvgimport org.kde.plasma.components as PlasmaComponents3ItemAbstractDelegate {id: rootproperty alias iconSize: icon.implicitWidthproperty int itemIndex: root.indexproperty var m: modelproperty bool showUnfavoritePlaceholder: falseproperty bool isDraggableFavorite: falsewidth: GridView.view.cellWidthheight: widthenabled: !root.disabledfavoritesModel: GridView.view.model.favoritesModelbaseModel: GridView.view.modeldragActive: dragHandler.activeAccessible.role: Accessible.MenuItemAccessible.name: model.display ?? ""DragHandler {id: dragHandlertarget: nullonActiveChanged: if (active) {root.contentItem.grabToImage(function(result) {root.Drag.imageSource = result.urlroot.Drag.active = true})} else {root.Drag.active = false}}Drag.dragType: Drag.AutomaticDrag.mimeData: {let mimeData = {}if (root.isDraggableFavorite) {mimeData["favoritedrag"] = ""}if (root.url.toString().length > 0) {mimeData["text/uri-list"] = [root.url]}return mimeData}background.visible: false // we want the default background's spacing, but not the base colorcontentItem: ColumnLayout {spacing: Kirigami.Units.smallSpacingvisible: !root.showUnfavoritePlaceholderKirigami.Icon {id: iconLayout.alignment: Qt.AlignHCenter | Qt.AlignBottomimplicitHeight: widthanimated: falsesource: root.model.decorationLoader {anchors {right: parent.rightrightMargin: -root.rightPaddingtop: parent.top}visible: activeactive: root.isNewlyInstalled ?? falsesourceComponent: Kirigami.Badge {text: i18nc("@label Newly-installed app, badge, keep short", "New!")type: Kirigami.Badge.Type.PositiveAccessible.name: i18nc("@label Accessible name for badge", "Newly-installed application")}}}PlasmaComponents3.Label {id: labelLayout.fillWidth: trueLayout.preferredHeight: label.lineCount === 1 ? label.implicitHeight * 2 : label.implicitHeighthorizontalAlignment: Text.AlignHCentermaximumLineCount: 2elide: Text.ElideMiddlewrapMode: Text.Wraptext: root.model.display ?? ""textFormat: Text.PlainText}}Loader {active: root.showUnfavoritePlaceholderanchors.fill: parentsourceComponent: Item {KSvg.FrameSvgItem {anchors.fill: parentimagePath: "widgets/viewitem"prefix: "selected"opacity: 0.5Kirigami.Icon {anchors.centerIn: parentwidth: root.iconSizeheight: widthsource: "list-remove"active: false}}}}PlasmaComponents3.ToolTip {text: root.model.description ?? ""visible: root.hovered && !ActionMenu.opened}}