123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import QtQuick 1.0
-
- Rectangle {
- id: colorpicker
-
- color: "red"
- Rectangle {
- id: pickControl
-
- x: 40; y: 0; z: 10
- width: 260; height: 50
- color: "white"
- border {color: "black"; width: 3}
- radius: 5
- opacity: 0
-
- Repeater {
- model: ListModel {
-
- ListElement {
- theColor: "red"
- }
- ListElement {
- theColor: "orange"
- }
- ListElement {
- theColor: "yellow"
- }
- ListElement {
- theColor: "green"
- }
- ListElement {
- theColor: "blue"
- }
- ListElement {
- theColor: "indigo"
- }
- ListElement {
- theColor: "violet"
- }
- }
- Rectangle {
- width: 30; height: 30
- x: (35*index)+10; y: 10
- color: theColor
- opacity: 1
-
- MouseArea {
- anchors.fill: parent
-
- onClicked: {
- pickControl.opacity = 0
- colorpicker.color = parent.color
- }
- }
- }
- }
-
- Behavior on opacity {
- PropertyAnimation {
- duration: 250
- }
- }
- }
- MouseArea {
- anchors.fill: parent
-
- onClicked: {
- pickControl.opacity = 1
- }
- }
- }
|