Warning, /plasma/plasma-desktop/applets/kickoff/package/contents/ui/ListOfGridsView.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2022 Tanbir Jishan <tantalising007@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 import QtQuick 2.15
0008 import QtQml 2.15
0009 import org.kde.plasma.core as PlasmaCore
0010 import org.kde.kitemmodels 1.0 as KItemModels
0011 
0012 KickoffListView {
0013     id: root
0014     required property var gridModel
0015 
0016     highlight: null // highlight off since it otherwise highlights a whole section
0017     model: gridModel.sections
0018     section.property: "section"
0019     delegate: ListOfGridsViewDelegate {
0020         width: root.width
0021 
0022         allAppsSection: section
0023         isCurrentSectionGrid: ListView.isCurrentItem
0024         isSearchFieldActive: kickoff.contentArea === root && kickoff.searchField.activeFocus
0025         parentView: ListView.view
0026         gridIndex: index
0027 
0028         model: KItemModels.KSortFilterProxyModel {
0029             id: sectionModel
0030 
0031             sourceModel: root.gridModel
0032             filterString: allAppsSection
0033             filterRoleName: "group"
0034 
0035             function trigger(row, actionId, argument) {
0036                 const filteredIndex = sectionModel.index(row, 0)
0037                 const sourceIndex = sectionModel.mapToSource(filteredIndex)
0038                 sourceModel.trigger(sourceIndex.row, actionId, argument)
0039             }
0040         }
0041         onShowSectionView: sectionName => {
0042             root.showSectionViewRequested(sectionName)
0043         }
0044     }
0045 }