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

0001 /*
0002     SPDX-FileCopyrightText: 2011 Daker Fernandes Pinheiro <dakerfp@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 import QtQuick
0008 import org.kde.plasma.components as PlasmaComponents
0009 
0010 
0011 PlasmaComponents.Page {
0012 
0013     tools: PlasmaComponents.ToolBarLayout {
0014         spacing: 5
0015         PlasmaComponents.ToolButton {
0016             visible: pageStack.depth > 1
0017             iconSource: "go-previous"
0018             onClicked: pageStack.pop()
0019         }
0020         PlasmaComponents.CheckBox {
0021             text: "Checkbox in the toolbar"
0022         }
0023         PlasmaComponents.TextField {
0024             clearButtonShown: true
0025             text: "hello"
0026         }
0027     }
0028 
0029     Flickable {
0030         id: flickable
0031         contentWidth: column.width
0032         contentHeight: column.height
0033         clip: true
0034         anchors.fill: parent
0035 
0036         Item {
0037             width: Math.max(flickable.width, column.width)
0038             height: column.height
0039             Column {
0040                 id: column
0041                 spacing: 20
0042                 anchors.horizontalCenter: parent.horizontalCenter
0043 
0044                 PlasmaComponents.Label {
0045                     font.pixelSize: 20
0046                     text: "Check Box"
0047                 }
0048 
0049                 PlasmaComponents.CheckBox {
0050                     width: 140
0051                     height: 30
0052                     text: "Check Box 1"
0053 
0054                     onCheckedChanged: {
0055                         if (checked)
0056                             console.log("CheckBox checked");
0057                         else
0058                             console.log("CheckBox unchecked");
0059                     }
0060                     onClicked: {
0061                         console.log("CheckBox clicked");
0062                     }
0063                 }
0064 
0065                 PlasmaComponents.CheckBox {
0066                     height: 30
0067                     text: "Disabled"
0068                     enabled: false
0069                 }
0070 
0071                 PlasmaComponents.CheckBox {
0072                     height: 30
0073                     text: ""
0074                 }
0075 
0076                 PlasmaComponents.CheckBox {
0077                     height: 30
0078                     text: "A loooooooooooooong text"
0079                 }
0080 
0081                 PlasmaComponents.Label {
0082                     font.pixelSize: 20
0083                     text: "Radio Button"
0084                 }
0085 
0086                 PlasmaComponents.RadioButton {
0087                     width: 140
0088                     height: 30
0089                     text: "RadioButton"
0090 
0091                     onCheckedChanged: {
0092                         if (checked)
0093                             console.log("RadioButton Checked");
0094                         else
0095                             console.log("RadioButton Unchecked");
0096                     }
0097                 }
0098 
0099                 PlasmaComponents.Switch { }
0100 
0101                 PlasmaComponents.Label {
0102                     font.pixelSize: 20
0103                     text: "Button Row"
0104                 }
0105 
0106                 PlasmaComponents.ButtonRow {
0107                     spacing: 20
0108                     PlasmaComponents.RadioButton { text: "A" }
0109                     PlasmaComponents.RadioButton { text: "B" }
0110                     PlasmaComponents.RadioButton { text: "C" }
0111                 }
0112 
0113                 PlasmaComponents.Label {
0114                     font.pixelSize: 20
0115                     text: "Button Column"
0116                 }
0117 
0118                 PlasmaComponents.ButtonColumn {
0119                     spacing: 20
0120                     PlasmaComponents.RadioButton { text: "Alice" }
0121                     PlasmaComponents.RadioButton { text: "Bob" }
0122                     PlasmaComponents.RadioButton { text: "Charles" }
0123                 }
0124 
0125             }
0126         }
0127     }
0128 
0129     PlasmaComponents.ScrollBar {
0130         id: horizontalScrollBar
0131 
0132         flickableItem: flickable
0133         orientation: Qt.Horizontal
0134         anchors {
0135             left: parent.left
0136             right: verticalScrollBar.left
0137             bottom: parent.bottom
0138         }
0139     }
0140 
0141     PlasmaComponents.ScrollBar {
0142         id: verticalScrollBar
0143 
0144         orientation: Qt.Vertical
0145         flickableItem: flickable
0146         anchors {
0147             top: parent.top
0148             right: parent.right
0149             bottom: horizontalScrollBar.top
0150         }
0151     }
0152 }