/*Copyright (C) 2011 Martin GrΓ€Γlin <mgraesslin@kde.org>Copyright (C) 2012 Gregor Taetzner <gregor@freenet.de>Copyright 2014 Sebastian KΓΌgler <sebas@kde.org>Copyright (C) 2015-2018 Eike Hein <hein@kde.org>Copyright (C) 2021 by Mikel Johnson <mikel5764@gmail.com>This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public License alongwith this program; if not, write to the Free Software Foundation, Inc.,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.*/import QtQuick 2.0import org.kde.plasma.core 2.0 as PlasmaCoreimport org.kde.plasma.components 3.0 as PlasmaComponents3import org.kde.plasma.extras 2.0 as PlasmaExtrasimport org.kde.plasma.private.kicker 0.1 as KickerFocusScope {id: appViewContainerproperty QtObject activatedSection: nullproperty string newBreadcrumbName: ""signal appModelChange()objectName: "ApplicationsGroupView"property ListView listView: applicationsView.listViewfunction keyNavUp() {return applicationsView.keyNavUp();}function keyNavDown() {return applicationsView.keyNavDown();}function activateCurrentIndex() {applicationsView.activatedItem = applicationsView.currentItemapplicationsView.moveRight()}function openContextMenu() {applicationsView.currentItem.openActionMenu();}function reset() {applicationsView.model = rootModel;}function refreshed() {reset();updatedLabelTimer.running = true;}Connections {target: plasmoidfunction onExpandedChanged() {if (!plasmoid.expanded) {reset();}}}Kicker.TriangleMouseFilter {anchors.fill: parentedge: LayoutMirroring.enabled ? Qt.LeftEdge : Qt.RightEdgeKickoffListView {id: applicationsViewisManagerMode: trueanchors.fill: parentproperty Item activatedItem: nullproperty var newModel: nullBehavior on opacity {NumberAnimation {duration: PlasmaCore.Units.longDurationeasing.type: Easing.InOutQuad}}focus: trueappView: truemodel: rootModelfunction moveRight() {var childModel = activatedItem.activate()if (childModel != null) {appViewContainer.activatedSection = childModel.modelappViewContainer.newBreadcrumbName = childModel.nameappViewContainer.appModelChange()}}onReset: appViewContainer.reset()}}// Displays text when application list gets updatedTimer {id: updatedLabelTimer// We want to have enough time to show that applications have been updated even for those who disabled animationsinterval: 1500running: falserepeat: trueonRunningChanged: {if (running) {updatedLabel.opacity = 1;applicationsView.listView.opacity = 0;}}onTriggered: {updatedLabel.opacity = 0;applicationsView.listView.opacity = 1;running = false;}}PlasmaExtras.PlaceholderMessage {id: updatedLabelwidth: parent.width - (PlasmaCore.Units.largeSpacing * 4)text: i18n("Updating applications...")iconName: "view-refresh"opacity: 0visible: opacity != 0anchors.centerIn: parentBehavior on opacity {NumberAnimation {duration: PlasmaCore.Units.shortDurationeasing.type: Easing.InOutQuad}}}Component.onCompleted: {rootModel.cleared.connect(refreshed);}} // appViewContainer