2011-07-14 17:10:08 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import QtQuick 1.0
|
|
|
|
import org.kde.plasma.components 0.1 as PlasmaComponents
|
|
|
|
|
|
|
|
Column {
|
|
|
|
spacing: 20
|
|
|
|
|
2011-10-13 15:19:37 +02:00
|
|
|
PlasmaComponents.Label {
|
2011-07-14 17:10:08 +02:00
|
|
|
font.pixelSize: 20
|
|
|
|
text: "Slider"
|
|
|
|
}
|
|
|
|
|
2011-07-15 14:24:44 +02:00
|
|
|
PlasmaComponents.Highlight {
|
|
|
|
width: 300
|
|
|
|
height: 400
|
|
|
|
Column {
|
|
|
|
anchors {
|
|
|
|
fill: parent
|
|
|
|
}
|
|
|
|
spacing: 10
|
|
|
|
|
2011-10-13 15:19:37 +02:00
|
|
|
PlasmaComponents.Label { text: "Color Selector"; font.pixelSize: 20 }
|
2011-07-15 14:24:44 +02:00
|
|
|
|
2011-10-13 15:19:37 +02:00
|
|
|
PlasmaComponents.Label { text: "Red" }
|
2011-07-15 14:24:44 +02:00
|
|
|
|
|
|
|
PlasmaComponents.Slider {
|
|
|
|
id: redSlider
|
|
|
|
height: 20
|
|
|
|
width: 255
|
|
|
|
orientation: Qt.Horizontal
|
|
|
|
minimumValue: 0
|
|
|
|
maximumValue: 255
|
|
|
|
stepSize: 10
|
|
|
|
Keys.onTabPressed: greenSlider.forceActiveFocus()
|
|
|
|
}
|
|
|
|
|
2011-10-13 15:19:37 +02:00
|
|
|
PlasmaComponents.Label { text: "Green" }
|
2011-07-15 14:24:44 +02:00
|
|
|
|
|
|
|
PlasmaComponents.Slider {
|
|
|
|
id: greenSlider
|
|
|
|
height: 20
|
|
|
|
width: 255
|
|
|
|
orientation: Qt.Horizontal
|
|
|
|
minimumValue: 0
|
|
|
|
maximumValue: 255
|
|
|
|
stepSize: 10
|
|
|
|
animated: true
|
|
|
|
Keys.onTabPressed: blueSlider.forceActiveFocus()
|
|
|
|
}
|
|
|
|
|
2011-10-13 15:19:37 +02:00
|
|
|
PlasmaComponents.Label { text: "Blue" }
|
2011-07-15 14:24:44 +02:00
|
|
|
|
|
|
|
PlasmaComponents.Slider {
|
|
|
|
id: blueSlider
|
|
|
|
height: 20
|
|
|
|
width: 255
|
|
|
|
orientation: Qt.Horizontal
|
|
|
|
minimumValue: 0
|
|
|
|
maximumValue: 255
|
|
|
|
stepSize: 10
|
|
|
|
Keys.onTabPressed: redSlider.forceActiveFocus()
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
width: parent.width / 2
|
|
|
|
height: width
|
|
|
|
color: Qt.rgba(redSlider.value / 255, greenSlider.value / 255, blueSlider.value / 255, 1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-13 15:19:37 +02:00
|
|
|
PlasmaComponents.Label { text: "Disabled Horizontal Slider" }
|
2011-07-19 00:09:50 +02:00
|
|
|
|
2011-07-14 17:10:08 +02:00
|
|
|
PlasmaComponents.Slider {
|
2011-07-19 00:09:50 +02:00
|
|
|
id: horizontalSlider
|
2011-07-14 17:10:08 +02:00
|
|
|
width: 140
|
|
|
|
height: 20
|
|
|
|
animated: true
|
2011-07-19 00:09:50 +02:00
|
|
|
enabled: false
|
2011-07-14 17:10:08 +02:00
|
|
|
}
|
|
|
|
|
2011-10-13 15:19:37 +02:00
|
|
|
PlasmaComponents.Label { text: "Inverted Horizontal Slider" }
|
2011-10-11 14:52:39 +02:00
|
|
|
|
|
|
|
PlasmaComponents.Slider {
|
|
|
|
id: invHorizontalSlider
|
|
|
|
width: 140
|
|
|
|
height: 20
|
|
|
|
inverted: true
|
|
|
|
animated: true
|
|
|
|
enabled: true
|
|
|
|
}
|
|
|
|
|
2011-10-13 15:19:37 +02:00
|
|
|
PlasmaComponents.Label { text: "Vertical Slider" }
|
2011-07-19 00:09:50 +02:00
|
|
|
|
|
|
|
Row {
|
|
|
|
spacing: 30
|
|
|
|
PlasmaComponents.Slider {
|
|
|
|
id: verticalSlider
|
|
|
|
width: 20
|
|
|
|
height: 140
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
minimumValue: 10
|
|
|
|
maximumValue: 1000
|
|
|
|
stepSize: 50
|
|
|
|
inverted: true
|
|
|
|
animated: true
|
|
|
|
}
|
2011-10-13 15:19:37 +02:00
|
|
|
PlasmaComponents.Label { text: verticalSlider.value }
|
2011-07-14 17:10:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|