Warning, /plasma/libplasma/examples/applets/widgetgallery/contents/ui/Sliders.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 PlasmaComponents.Page {
0011     height: childrenRect.height
0012     property int implicitHeight: childrenRect.height
0013 
0014     tools: PlasmaComponents.ToolBarLayout {
0015         spacing: 5
0016         PlasmaComponents.ToolButton {
0017             visible: pageStack.depth > 1
0018             iconSource: "go-previous"
0019             onClicked: pageStack.pop()
0020         }
0021         PlasmaComponents.Slider {
0022             width: 140
0023             enabled: true
0024         }
0025         PlasmaComponents.TextField {
0026             clearButtonShown: true
0027             text: "hello"
0028         }
0029     }
0030 
0031     Flickable {
0032         id: flickable
0033         contentWidth: column.width
0034         contentHeight: column.height
0035         clip: true
0036         anchors.fill: parent
0037 
0038         Item {
0039             width: Math.max(flickable.width, column.width)
0040             height: column.height
0041             Column {
0042                 id: column
0043                 spacing: 20
0044                 anchors.horizontalCenter: parent.horizontalCenter
0045 
0046                 PlasmaComponents.Label {
0047                     font.pixelSize: 20
0048                     text: "Slider"
0049                 }
0050 
0051 
0052                 Column {
0053                     spacing: 10
0054 
0055                     PlasmaComponents.Label { text: "Color Selector"; font.pixelSize: 20 }
0056 
0057                     PlasmaComponents.Label { text: "Red" }
0058 
0059                     PlasmaComponents.Slider {
0060                         id: redSlider
0061                         height: 20
0062                         width: 255
0063                         orientation: Qt.Horizontal
0064                         minimumValue: 0
0065                         maximumValue: 255
0066                         stepSize: 10
0067                         Keys.onTabPressed: greenSlider.forceActiveFocus()
0068                     }
0069 
0070                     PlasmaComponents.Label { text: "Green" }
0071 
0072                     PlasmaComponents.Slider {
0073                         id: greenSlider
0074                         height: 20
0075                         width: 255
0076                         orientation: Qt.Horizontal
0077                         minimumValue: 0
0078                         maximumValue: 255
0079                         tickmarksEnabled: true
0080                         stepSize: 10
0081                         Keys.onTabPressed: blueSlider.forceActiveFocus()
0082                     }
0083 
0084                     PlasmaComponents.Label { text: "Blue" }
0085 
0086                     PlasmaComponents.Slider {
0087                         id: blueSlider
0088                         height: 20
0089                         width: 255
0090                         orientation: Qt.Horizontal
0091                         minimumValue: 0
0092                         maximumValue: 255
0093                         stepSize: 10
0094                         Keys.onTabPressed: redSlider.forceActiveFocus()
0095                     }
0096 
0097                     Rectangle {
0098                         anchors.horizontalCenter: parent.horizontalCenter
0099                         width: parent.width / 2
0100                         height: width
0101                         color: Qt.rgba(redSlider.value / 255, greenSlider.value / 255, blueSlider.value / 255, 1)
0102                     }
0103                 }
0104 
0105                 PlasmaComponents.Label { text: "Disabled Horizontal Slider" }
0106 
0107                 PlasmaComponents.Slider {
0108                     id: horizontalSlider
0109                     width: 140
0110                     height: 20
0111                     enabled: false
0112                 }
0113 
0114                 PlasmaComponents.Label { text: "Inverted Horizontal Slider" }
0115 
0116                 PlasmaComponents.Slider {
0117                     id: invHorizontalSlider
0118                     width: 140
0119                     height: 20
0120                     inverted: true
0121                     enabled: true
0122                 }
0123 
0124                 PlasmaComponents.Label { text: "Vertical Slider" }
0125 
0126                 Row {
0127                     spacing: 30
0128                     PlasmaComponents.Slider {
0129                         id: verticalSlider
0130                         width: 20
0131                         height: 140
0132                         orientation: Qt.Vertical
0133                         minimumValue: 10
0134                         maximumValue: 1000
0135                         stepSize: 50
0136                         inverted: true
0137                     }
0138                     PlasmaComponents.Label { text: verticalSlider.value }
0139                 }
0140 
0141             }
0142         }
0143     }
0144 
0145     PlasmaComponents.ScrollBar {
0146         id: horizontalScrollBar
0147 
0148         flickableItem: flickable
0149         orientation: Qt.Horizontal
0150         anchors {
0151             left: parent.left
0152             right: verticalScrollBar.left
0153             bottom: parent.bottom
0154         }
0155     }
0156 
0157     PlasmaComponents.ScrollBar {
0158         id: verticalScrollBar
0159 
0160         orientation: Qt.Vertical
0161         flickableItem: flickable
0162         anchors {
0163             top: parent.top
0164             right: parent.right
0165             bottom: horizontalScrollBar.top
0166         }
0167     }
0168 }