Warning, /plasma/libplasma/examples/applets/testcomponents/contents/ui/PlasmoidPage.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2013 Sebastian Kügler <sebas@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 import QtQuick
0008 import org.kde.plasma.plasmoid
0009 import org.kde.plasma.components as PlasmaComponents
0010 import org.kde.kquickcontrolsaddons as KQuickControlsAddons
0011 import org.kde.kirigami as Kirigami
0012 
0013 // PlasmoidPage
0014 
0015 PlasmaComponents.Page {
0016     id: plasmoidPage
0017     anchors {
0018         fill: parent
0019         margins: _s
0020     }
0021     Column {
0022         anchors.centerIn: parent
0023         spacing: _s
0024         Kirigami.Heading {
0025             level: 2
0026             text: "I'm an applet"
0027         }
0028 
0029         PlasmaComponents.ButtonColumn {
0030             PlasmaComponents.RadioButton {
0031                 text: "No background"
0032                 onClicked: {
0033                     if (checked) Plasmoid.backgroundHints = 0;
0034                 }
0035             }
0036             PlasmaComponents.RadioButton {
0037                 text: "Default background"
0038                 checked: true
0039                 onClicked: {
0040                     if (checked) Plasmoid.backgroundHints = 1;
0041                 }
0042             }
0043             PlasmaComponents.RadioButton {
0044                 text: "Translucent background"
0045                 onClicked: {
0046                     if (checked) Plasmoid.backgroundHints = 2;
0047                 }
0048             }
0049         }
0050 
0051         PlasmaComponents.Button {
0052             height: Kirigami.Units.iconSizes.desktop
0053             text: "Busy"
0054             checked: Plasmoid.busy
0055             onClicked: {
0056                 Plasmoid.busy = !Plasmoid.busy
0057             }
0058         }
0059 
0060         PlasmaComponents.Button {
0061             id: ctxButton
0062             height: Kirigami.Units.iconSizes.desktop
0063             text: "Context Menu"
0064             Loader {
0065                 id: menuLoader
0066             }
0067             onClicked: {
0068                 if (menuLoader.source == "") {
0069                    menuLoader.source = "TestMenu.qml"
0070                 } else {
0071                     //menuLoader.source = ""
0072                 }
0073                 menuLoader.item.open(0, height);
0074             }
0075         }
0076     }
0077 }
0078