/*SPDX-FileCopyrightText: 2013-2015 Eike Hein <hein@kde.org>SPDX-License-Identifier: GPL-2.0-or-later*/pragma ComponentBehavior: Boundimport QtQuickimport org.kde.kirigami as Kirigamiimport org.kde.plasma.components as PC3import org.kde.plasma.extras as PlasmaExtrasimport org.kde.ksvg as KSvgItemAbstractDelegate {id: rootreadonly property int itemIndex: model.indexreadonly property bool isDropPlaceHolder: "dropPlaceholderIndex" in root.baseModel && root.itemIndex === root.baseModel.dropPlaceholderIndexproperty bool showUnfavoritePlaceholder: falseAccessible.role: Accessible.ListItemicon.source: root.decorationicon.width: Kirigami.Units.iconSizes.mediumicon.height: Kirigami.Units.iconSizes.mediumhoverEnabled: truedragActive: dragHandler.activebackground.visible: false // we want the default background's spacing, but not the base colorcontentItem: Kirigami.Icon {visible: !root.showUnfavoritePlaceholder && !root.isDropPlaceHolderactive: root.hoveredwidth: root.icon.widthheight: root.icon.heightsource: root.icon.source}Loader {active: root.hovered || root.visualFocus || dragHandler.active || root.isDropPlaceHolder || root.showUnfavoritePlaceholderanchors.fill: parentsourceComponent: Item {id: highlightItemanchors.fill: parentPlasmaExtras.Highlight {anchors.fill: parentvisible: !root.isDropPlaceHolder && !root.showUnfavoritePlaceholderhovered: truepressed: root.pressed}KSvg.FrameSvgItem {anchors.fill: parentvisible: root.isDropPlaceHolder || root.showUnfavoritePlaceholderimagePath: "widgets/viewitem"prefix: "selected"opacity: 0.5Kirigami.Icon {anchors.centerIn: parentwidth: root.icon.widthheight: widthsource: root.isDropPlaceHolder ? "list-add" : "list-remove"active: false}}}}DragHandler {id: dragHandlertarget: nullonActiveChanged: if (active) {root.contentItem.grabToImage(function(result) {root.Drag.imageSource = result.urlroot.Drag.active = true // using a binding can cause loop warnings when unexpanding})} else {root.Drag.active = false}}Drag.dragType: Drag.AutomaticDrag.mimeData: {let mimeData = { 'favoritedrag': '' }if (root.url.toString().length > 0) {mimeData["text/uri-list"] = [root.url]}return mimeData}PC3.ToolTip {text: root.text}}