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

0001 /*
0002     SPDX-FileCopyrightText: 2011 Martin *Gräßlin <mgraesslin@kde.org>
0003     SPDX-FileCopyrightText: 2012 Gregor Taetzner <gregor@freenet.de>
0004     SPDX-FileCopyrightText: 2014 Sebastian Kügler <sebas@kde.org>
0005     SPDX-FileCopyrightText: 2015-2018 Eike Hein <hein@kde.org>
0006     SPDX-FileCopyrightText: 2021 Mikel Johnson <mikel5764@gmail.com>
0007     SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
0008     SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org>
0009 
0010     SPDX-License-Identifier: GPL-2.0-or-later
0011  */
0012 import QtQuick 2.15
0013 import QtQml 2.15
0014 import QtQuick.Layouts 1.15
0015 import org.kde.plasma.components 3.0 as PC3
0016 import org.kde.kirigami 2.20 as Kirigami
0017 
0018 AbstractKickoffItemDelegate {
0019     id: root
0020 
0021     leftPadding: KickoffSingleton.listItemMetrics.margins.left
0022     rightPadding: KickoffSingleton.listItemMetrics.margins.right
0023     topPadding: Kirigami.Units.smallSpacing * 2
0024     bottomPadding: Kirigami.Units.smallSpacing * 2
0025 
0026     icon.width: Kirigami.Units.iconSizes.large
0027     icon.height: Kirigami.Units.iconSizes.large
0028 
0029     labelTruncated: label.truncated
0030     descriptionVisible: false
0031 
0032     dragIconItem: iconItem
0033 
0034     contentItem: ColumnLayout {
0035         spacing: root.spacing
0036 
0037         Kirigami.Icon {
0038             id: iconItem
0039             implicitWidth: root.icon.width
0040             implicitHeight: root.icon.height
0041             Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
0042 
0043             animated: false
0044             selected: root.iconAndLabelsShouldlookSelected
0045             source: root.decoration || root.icon.name || root.icon.source
0046         }
0047 
0048         PC3.Label {
0049             id: label
0050             Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
0051             Layout.fillWidth: true
0052             Layout.preferredHeight: label.lineCount === 1 ? label.implicitHeight * 2 : label.implicitHeight
0053 
0054             text: root.text
0055             textFormat: Text.PlainText
0056             elide: Text.ElideRight
0057             horizontalAlignment: Text.AlignHCenter
0058             verticalAlignment: Text.AlignTop
0059             maximumLineCount: 2
0060             wrapMode: Text.Wrap
0061             color: root.iconAndLabelsShouldlookSelected ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
0062         }
0063     }
0064 }