Warning, /frameworks/kirigami/tests/actionsMenu.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2016 Aleix Pol Gonzalez <aleixpol@kde.org>
0003  *  SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
0004  *
0005  *  SPDX-License-Identifier: LGPL-2.0-or-later
0006  */
0007 
0008 import QtQuick 2.15
0009 import QtQuick.Controls 2.15 as QQC2
0010 import org.kde.kirigami 2.20 as Kirigami
0011 
0012 Kirigami.ApplicationWindow {
0013     id: main
0014 
0015     pageStack.initialPage: Kirigami.Page {
0016         QQC2.Button {
0017             text: "button"
0018             onClicked: menu.popup()
0019             QQC2.Menu {
0020                 id: menu
0021 
0022                 QQC2.MenuItem { text: "xxx" }
0023                 QQC2.MenuItem { text: "xxx" }
0024                 QQC2.Menu {
0025                     title: "yyy"
0026                     QQC2.MenuItem { text: "yyy" }
0027                     QQC2.MenuItem { text: "yyy" }
0028                 }
0029             }
0030         }
0031 
0032         title: "aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"
0033         actions {
0034             main:  Kirigami.Action { icon.name: "kate"; text: "BonDia" }
0035             left : Kirigami.Action { icon.name: "kate"; text: "BonDia" }
0036             right: Kirigami.Action { icon.name: "kate"; text: "BonDia" }
0037         }
0038 
0039         QQC2.ActionGroup {
0040             id: group
0041         }
0042 
0043         actions.contextualActions: [
0044             Kirigami.Action {
0045                 text: "submenus"
0046                 icon.name: "kalgebra"
0047 
0048                 Kirigami.Action { text: "xxx"; onTriggered: console.log("xxx") }
0049                 Kirigami.Action { text: "xxx"; onTriggered: console.log("xxx") }
0050                 Kirigami.Action { text: "xxx"; onTriggered: console.log("xxx") }
0051                 Kirigami.Action {
0052                     text: "yyy"
0053                     Kirigami.Action { text: "yyy" }
0054                     Kirigami.Action { text: "yyy" }
0055                     Kirigami.Action { text: "yyy" }
0056                     Kirigami.Action { text: "yyy" }
0057                 }
0058             },
0059             Kirigami.Action {
0060                 id: optionsAction
0061                 text: "Options"
0062                 icon.name: "kate"
0063 
0064                 Kirigami.Action {
0065                     QQC2.ActionGroup.group: group
0066                     text: "A"
0067                     checkable: true
0068                     checked: true
0069                 }
0070                 Kirigami.Action {
0071                     QQC2.ActionGroup.group: group
0072                     text: "B"
0073                     checkable: true
0074                 }
0075                 Kirigami.Action {
0076                     QQC2.ActionGroup.group: group
0077                     text: "C"
0078                     checkable: true
0079                 }
0080             },
0081             Kirigami.Action { text: "stuffing..." },
0082             Kirigami.Action { text: "stuffing..." },
0083             Kirigami.Action { text: "stuffing..." },
0084             Kirigami.Action { text: "stuffing..." },
0085             Kirigami.Action { text: "stuffing..." }
0086         ]
0087     }
0088 }