5c358af0f1ec8a5f36c4c5bdc94d70cbea77440d
[harmattan/cameraplus] / qml / Selector.qml
1 // -*- qml -*-
2 import QtQuick 1.1
3 import com.nokia.meego 1.1
4 import QtCamera 1.0
5
6 Button {
7         id: button
8         width: 56
9         height: 56
10
11         opacity: 0.5
12
13         property alias widget: __widget.children
14         property bool timerConstraints: false
15         property alias title: label.text
16
17         checkable: true
18
19         function close() {
20                 button.checked = false;
21         }
22
23         Timer {
24                 interval: 2000
25                 running: mouse.enabled && !button.timerConstraints
26                 repeat: false
27                 onTriggered: button.close();
28         }
29
30         MouseArea {
31                 id: mouse
32                 parent: button.parent
33                 anchors.fill: parent
34                 enabled: button.checked
35                 onClicked: button.close();
36
37                 Label {
38                         id: label
39                         y: button.y
40                         x: button.x + button.width + 20
41                         visible: button.checked
42                 }
43
44                 Item {
45                         id: __widget
46                         anchors.top: label.bottom
47                         anchors.topMargin: 10
48 //                        y: button.y
49                         x: button.x + button.width + 20
50                         visible: button.checked
51                 }
52         }
53 }