summaryrefslogtreecommitdiffstats
path: root/CoffeeTweed/Remove.qml
blob: 66c35f1b6791ec991832528dd482e3b4205f71c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import Qt 4.7

Item {
    id: bt_remove
    width: 188; height: 188

    signal removeClicked

    Image {
        id: bt_remove_off;
        source: "images/bt_remove_off.png";
    }

    Image {
        id: bt_remove_on;
        source: "images/bt_remove_on.png";
        opacity: 0;
        Behavior on opacity { NumberAnimation { duration: 150; } }
    }

    MouseArea {
        anchors.fill: parent
        onPressed: { bt_remove.state = "pressed" }
        onReleased: { bt_remove.state = "released"; bt_remove.removeClicked() }

    }

    states: [
        State {
            name: "pressed"
            PropertyChanges{ target: bt_remove_on; opacity: 1; }
        },
        State {
            name: "released"
            PropertyChanges{ target: bt_remove_on; opacity: 0; }
        }
    ]

}