/*SPDX-FileCopyrightText: 2014-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.plasma.core as PlasmaCoreimport org.kde.plasma.plasmoidimport org.kde.plasma.private.kicker as KickerPlasmoidItem {id: kickersignal resetsignal modelRefreshedreadonly property bool isDash: Plasmoid.pluginName === "org.kde.plasma.kickerdash"switchWidth: isDash || !fullRepresentationItem ? 0 : fullRepresentationItem.Layout.minimumWidthswitchHeight: isDash || !fullRepresentationItem ? 0 : fullRepresentationItem.Layout.minimumHeight// this is a bit of a hack to prevent Plasma from spawning a dialog on its own when we're DashpreferredRepresentation: isDash ? fullRepresentation : nullcompactRepresentation: isDash ? null : compactRepresentationComponentfullRepresentation: isDash ? compactRepresentationComponent : menuRepresentationComponentreadonly property Component itemListDialogComponent: Component {ItemListDialog {}}property Kicker.KAStatsFavoritesModel globalFavorites: rootModelInstance.favoritesModel as Kicker.KAStatsFavoritesModelproperty Kicker.SimpleFavoritesModel systemFavorites: rootModelInstance.systemFavoritesModel as Kicker.SimpleFavoritesModelPlasmoid.icon: Plasmoid.configuration.useCustomButtonImage ? Plasmoid.configuration.customButtonImage : Plasmoid.configuration.icononSystemFavoritesChanged: {if (systemFavorites) {systemFavorites.favorites = Plasmoid.configuration.favoriteSystemActions;}}function action_menuedit() {processRunner.runMenuEditor();}Component {id: compactRepresentationComponentCompactRepresentation {dashWindowComponent: dashboardRepresentationComponenttoolTipSubText: kicker.toolTipSubText}}Component {id: menuRepresentationComponentMenuRepresentation {globalFavorites: kicker.globalFavoritessystemFavorites: kicker.systemFavoritesrootModel: rootModelInstancerunnerModel: runnerModelInstanceonInteractionConcluded: kicker.expanded = false}}Component {id: dashboardRepresentationComponentDashboardRepresentation {globalFavorites: kicker.globalFavoritessystemFavorites: kicker.systemFavoritesrootModel: rootModelInstancerunnerModel: runnerModelInstanceonInteractionConcluded: toggle()}}Kicker.RootModel {id: rootModelInstanceautoPopulate: falseappNameFormat: kicker.isDash ? 0 : Plasmoid.configuration.appNameFormat // appNameFormat = 0 -> AppName Onlyflat: kicker.isDash || Plasmoid.configuration.limitDepthsorted: Plasmoid.configuration.alphaSortshowSeparators: !kicker.isDash && !sortedshowRootSeparator: !kicker.isDashhighlightNewlyInstalledApps: Plasmoid.configuration.highlightNewlyInstalledApps// TODO: appletInterface property now can be ported to "applet" and have the real Applet* assigned directlyappletInterface: kickershowAllApps: kicker.isDashshowAllAppsCategorized: trueshowTopLevelItems: !kicker.isDashshowRecentApps: Plasmoid.configuration.showRecentAppsshowRecentDocs: Plasmoid.configuration.showRecentDocsshowRecentFolders: Plasmoid.configuration.showRecentFoldersrecentOrdering: Plasmoid.configuration.recentOrderingonShowRecentAppsChanged: {Plasmoid.configuration.showRecentApps = showRecentApps;}onShowRecentDocsChanged: {Plasmoid.configuration.showRecentDocs = showRecentDocs;}onRecentOrderingChanged: {Plasmoid.configuration.recentOrdering = recentOrdering;}Component.onCompleted: {(favoritesModel as Kicker.KAStatsFavoritesModel).initForClient("org.kde.plasma.kicker.favorites.instance-" + Plasmoid.id)if (!Plasmoid.configuration.favoritesPortedToKAstats) {if (favoritesModel.count < 1) {(favoritesModel as Kicker.KAStatsFavoritesModel).portOldFavorites(Plasmoid.configuration.favoriteApps);}Plasmoid.configuration.favoritesPortedToKAstats = true;}}}Connections {target: kicker.systemFavoritesfunction onFavoritesChanged() {Plasmoid.configuration.favoriteSystemActions = kicker.systemFavorites.favorites;}}Connections {target: Plasmoid.configurationfunction onFavoriteSystemActionsChanged() {kicker.systemFavorites.favorites = Plasmoid.configuration.favoriteSystemActions;}}Kicker.RunnerModel {id: runnerModelInstanceappletInterface: kickerfavoritesModel: kicker.globalFavorites as Kicker.KAStatsFavoritesModelrunners: {const results = ["krunner_services","krunner_systemsettings","krunner_sessions","krunner_powerdevil","calculator","unitconverter"];if (Plasmoid.configuration.useExtraRunners) {results.push(...Plasmoid.configuration.extraRunners);}return results;}}Kicker.DragHelper {id: dragHelperdragIconSize: Kirigami.Units.iconSizes.medium}Kicker.ProcessRunner {id: processRunner}Connections {target: kickerfunction onExpandedChanged(expanded) {if (!expanded) {kicker.reset();}}}Plasmoid.contextualActions: [PlasmaCore.Action {text: i18nc("@action:inmenu launches kmenuedit", "Edit Applicationsβ¦")icon.name: "kmenuedit"visible: Plasmoid.immutability !== PlasmaCore.Types.SystemImmutableonTriggered: processRunner.runMenuEditor()}]Component.onCompleted: {if (Plasmoid.hasOwnProperty("activationTogglesExpanded")) {Plasmoid.activationTogglesExpanded = !kicker.isDash}rootModelInstance.refreshed.connect(modelRefreshed);}}