Warning, /plasma/kdeplasma-addons/wallpapers/potd/package/contents/ui/ActionContextMenu.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *   SPDX-FileCopyrightText: 2022 Fushan Wen <qydwhotmail@gmail.com>
0003  *
0004  *   SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.15
0008 import QtQuick.Controls 2.15 as QQC2
0009 
0010 QQC2.Menu {
0011     id: contextMenu
0012 
0013     /**
0014      * Always show all actions regardless of visible property
0015      */
0016     property bool showAllActions: false
0017 
0018     /**
0019      * A list of extra actions in the context menu.
0020      */
0021     property list<QtObject> actions
0022 
0023     Repeater {
0024         model: contextMenu.actions
0025         delegate: QQC2.MenuItem {
0026             text: modelData.text || modelData.tooltip
0027             icon.name: modelData.iconName
0028             onTriggered: modelData.trigger()
0029             enabled: modelData.enabled
0030             visible: modelData.visible || contextMenu.showAllActions
0031 
0032             Accessible.description: modelData.Accessible.description
0033         }
0034     }
0035 
0036     onClosed: if (parent) parent.forceActiveFocus()
0037 }