Warning, /plasma/libplasma/examples/applets/widgetgallery/contents/ui/Buttons.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 QtQuick.Controls as QQC2 0009 import org.kde.plasma.components as PlasmaComponents 0010 0011 PlasmaComponents.Page { 0012 height: childrenRect.height 0013 tools: PlasmaComponents.ToolBarLayout { 0014 spacing: 5 0015 PlasmaComponents.ToolButton { 0016 visible: pageStack.depth > 1 0017 icon.name: "go-previous" 0018 onClicked: pageStack.pop() 0019 } 0020 PlasmaComponents.Button { 0021 text: "Button" 0022 } 0023 PlasmaComponents.TextField { 0024 clearButtonShown: true 0025 } 0026 } 0027 0028 Flickable { 0029 id: flickable 0030 contentWidth: column.width 0031 contentHeight: column.height 0032 clip: true 0033 anchors.fill: parent 0034 0035 Item { 0036 width: Math.max(flickable.width, column.width) 0037 height: column.height 0038 Column { 0039 id: column 0040 spacing: 20 0041 anchors.horizontalCenter: parent.horizontalCenter 0042 0043 PlasmaComponents.Label { 0044 font.pixelSize: 20 0045 text: "Buttons" 0046 } 0047 0048 PlasmaComponents.Button { 0049 id: bt1 0050 0051 text: "Button" 0052 0053 onClicked: { 0054 console.log("Clicked"); 0055 pageStack.push(Qt.createComponent("Scrollers.qml")) 0056 } 0057 0058 Keys.onTabPressed: bt2.forceActiveFocus(); 0059 } 0060 0061 PlasmaComponents.Button { 0062 id: bt2 0063 0064 text: "Checkable Button" 0065 checkable: true 0066 0067 onCheckedChanged: { 0068 if (checked) 0069 console.log("Button Checked"); 0070 else 0071 console.log("Button Unchecked"); 0072 } 0073 0074 Keys.onTabPressed: bt3.forceActiveFocus(); 0075 } 0076 0077 PlasmaComponents.Button { 0078 id: bt3 0079 0080 text: "Different Font" 0081 font { 0082 pointSize: 20 0083 family: "Helvetica" 0084 } 0085 0086 Keys.onTabPressed: bt4.forceActiveFocus(); 0087 } 0088 0089 PlasmaComponents.Button { 0090 id: bt4 0091 0092 text: "Icon Button" 0093 icon.name: "konqueror" 0094 0095 Keys.onTabPressed: bt5.forceActiveFocus(); 0096 menu: QQC2.Menu { 0097 QQC2.MenuItem { text: "This Button" } 0098 QQC2.MenuItem { text: "Happens To Have" } 0099 QQC2.MenuItem { text: "A Menu Assigned" } 0100 } 0101 } 0102 0103 PlasmaComponents.Button { 0104 id: bt5 0105 0106 icon.name: "plasma" 0107 0108 Keys.onTabPressed: bt1.forceActiveFocus(); 0109 } 0110 0111 PlasmaComponents.Button { 0112 0113 text: "Disabled Button" 0114 enabled: false 0115 } 0116 0117 PlasmaComponents.ToolButton { 0118 text: "ToolButton" 0119 } 0120 0121 PlasmaComponents.ToolButton { 0122 text: "ToolButton not flat" 0123 flat: false 0124 } 0125 0126 PlasmaComponents.ToolButton { 0127 0128 text: "Icon ToolButton" 0129 icon.name: "konqueror" 0130 } 0131 0132 PlasmaComponents.ToolButton { 0133 icon.name: "plasma" 0134 } 0135 PlasmaComponents.ToolButton { 0136 icon.name: "plasma" 0137 flat: false 0138 } 0139 0140 PlasmaComponents.ToolButton { 0141 text: "Disabled ToolButton" 0142 enabled: false 0143 } 0144 } 0145 } 0146 } 0147 0148 PlasmaComponents.ScrollBar { 0149 id: horizontalScrollBar 0150 0151 flickableItem: flickable 0152 orientation: Qt.Horizontal 0153 anchors { 0154 left: parent.left 0155 right: verticalScrollBar.left 0156 bottom: parent.bottom 0157 } 0158 } 0159 0160 PlasmaComponents.ScrollBar { 0161 id: verticalScrollBar 0162 0163 orientation: Qt.Vertical 0164 flickableItem: flickable 0165 anchors { 0166 top: parent.top 0167 right: parent.right 0168 bottom: horizontalScrollBar.top 0169 } 0170 } 0171 }