Changeset View
Changeset View
Standalone View
Standalone View
sidebar/package/contents/ui/ActionMenu.qml
Show All 10 Lines | 1 | /* | |||
---|---|---|---|---|---|
11 | Library General Public License for more details. | 11 | Library General Public License for more details. | ||
12 | 12 | | |||
13 | You should have received a copy of the GNU Library General Public License | 13 | You should have received a copy of the GNU Library General Public License | ||
14 | along with this library; see the file COPYING.LIB. If not, write to | 14 | along with this library; see the file COPYING.LIB. If not, write to | ||
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
16 | Boston, MA 02110-1301, USA. | 16 | Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.3 | 19 | import QtQuick 2.5 | ||
20 | import QtQml 2.2 | 20 | import QtQuick.Controls 2.5 as QQC2 | ||
21 | import QtQuick.Controls 1.0 as QtControls | | |||
22 | 21 | | |||
23 | QtControls.Menu { | 22 | QQC2.Menu { | ||
24 | id: menu | 23 | id: menu | ||
25 | 24 | | |||
25 | modal: true | ||||
26 | | ||||
26 | property alias actions: instantiator.model | 27 | property alias actions: instantiator.model | ||
27 | 28 | | |||
28 | Instantiator { | 29 | Instantiator { | ||
29 | id: instantiator | 30 | id: instantiator | ||
30 | 31 | | |||
31 | delegate: QtControls.MenuItem { | 32 | delegate: QQC2.MenuItem { | ||
32 | readonly property QtObject action: systemsettings.action(modelData) | 33 | readonly property QtObject itemAction: systemsettings.action(modelData) | ||
33 | 34 | | |||
34 | text: action.text | 35 | indicator: null | ||
35 | iconName: systemsettings.actionIconName(modelData) | 36 | text: itemAction.text | ||
36 | visible: action.visible | 37 | icon.name: systemsettings.actionIconName(modelData) | ||
37 | enabled: action.enabled | 38 | visible: itemAction.visible | ||
38 | onTriggered: action.trigger() | 39 | enabled: itemAction.enabled | ||
40 | onTriggered: itemAction.trigger() | ||||
39 | } | 41 | } | ||
40 | 42 | | |||
41 | onObjectAdded: menu.insertItem(index, object) | 43 | onObjectAdded: menu.insertItem(index, object) | ||
42 | onObjectRemoved: menu.removeItem(object) | 44 | onObjectRemoved: menu.removeItem(object) | ||
43 | } | 45 | } | ||
44 | } | 46 | } |