/*SPDX-FileCopyrightText: 2013-2014 Eike Hein <hein@kde.org>SPDX-License-Identifier: GPL-2.0-or-later*/pragma ComponentBehavior: Boundimport QtQuickimport QtQuick.Layoutsimport org.kde.plasma.core as PlasmaCoreimport org.kde.plasma.plasmoidimport org.kde.plasma.private.kicker as KickerKicker.SubMenu {id: itemDialogproperty alias model: funnelModel.sourceModelproperty int index: -1property bool aboutToBeDestroyed: falseproperty alias mainSearchField: itemListView.mainSearchFieldsignal interactionConcludedvisible: falsebackgroundHints: Plasmoid.containmentDisplayHints & PlasmaCore.Types.ContainmentPrefersOpaqueBackground ? PlasmaCore.Dialog.SolidBackground : PlasmaCore.Dialog.StandardBackgroundlocation: PlasmaCore.Types.Floatingoffset: 0 // slightly overlap submenu to match QtWidgets menu behaviorLayoutMirroring.enabled: dialogMirroredLayoutMirroring.childrenInherit: trueonWindowDeactivated: {if (!aboutToBeDestroyed) {interactionConcluded()}}mainItem: ItemListView {id: itemListViewheight: implicitHeightwidth: Math.min(Math.max(Layout.minimumWidth, implicitWidth), Layout.maximumWidth)hoverEnabled: !hoverBlock.enablediconsEnabled: true// force tooltip for recent files - the path is relevant no matter the display settingshowDescriptionInTooltip: (funnelModel.sourceModel as Kicker.RecentUsageModel)?.shownItems === Kicker.RecentUsageModel.OnlyDocsdialog: itemDialogmodel: funnelModelonInteractionConcluded: itemDialog.interactionConcluded()Kicker.FunnelModel {id: funnelModelComponent.onCompleted: {kicker.reset.connect(funnelModel.reset);}onCountChanged: {if (sourceModel && count === 0) {itemDialog.delayedDestroy();}}onSourceModelChanged: {hoverBlock.reset()itemListView.currentIndex = -1;itemListView.resetDelegateSizing();}}HoverBlocker {id: hoverBlockanchors.fill: parentz: 10}}function delayedDestroy() {aboutToBeDestroyed = true;Qt.callLater(() => itemDialog.destroy());}}