Warning, /plasma/plasma-workspace/kcms/cursortheme/ui/Delegate.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 import QtQuick 2.1
0008 import QtQuick.Window 2.2
0009 import QtQuick.Layouts 1.1
0010 import Qt5Compat.GraphicalEffects
0011 
0012 import org.kde.kirigami 2.2 as Kirigami
0013 
0014 import org.kde.kcmutils as KCM
0015 import org.kde.private.kcm_cursortheme 1.0
0016 
0017 KCM.GridDelegate {
0018     id: delegate
0019 
0020     text: model.display
0021     toolTip: model.description
0022 
0023     opacity: model.pendingDeletion ? 0.3 : 1
0024 
0025     thumbnailAvailable: true
0026     thumbnail: PreviewWidget {
0027         id: previewWidget
0028         anchors.fill: parent
0029         themeModel: kcm.cursorsModel
0030         currentIndex: index
0031         currentSize: kcm.cursorThemeSettings.cursorSize
0032     }
0033 
0034     Connections {
0035         target: kcm
0036         function onThemeApplied() {
0037             previewWidget.refresh();
0038         }
0039     }
0040 
0041     actions: [
0042         Kirigami.Action {
0043             icon.name: "edit-delete"
0044             tooltip: i18n("Remove Theme")
0045             enabled: model.isWritable
0046             visible: !model.pendingDeletion
0047             onTriggered: model.pendingDeletion = true
0048         },
0049         Kirigami.Action {
0050             icon.name: "edit-undo"
0051             tooltip: i18n("Restore Cursor Theme")
0052             visible: model.pendingDeletion
0053             onTriggered: model.pendingDeletion = false
0054         }
0055     ]
0056 
0057     onClicked: {
0058         view.forceActiveFocus();
0059         kcm.cursorThemeSettings.cursorTheme = kcm.cursorThemeFromIndex(index);
0060     }
0061     onDoubleClicked: {
0062             kcm.save();
0063     }
0064 }