New GUI
[ubi] / qml / ubi / components / DialogBox.qml
1 import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
2 import "../UIConstants.js" as Const
3
4 Showable {
5     id: root
6
7     hidden: true
8     //easingType: Easing.InOutBounce
9
10     anchors.left: parent.left; anchors.right: parent.right
11     height: parent.height-Const.SYSTEM_BAR_HEIGHT+Const.SHADOW_OFFSET
12
13     signal opened()
14     signal canceled()
15
16     function open() {
17         root.forceActiveFocus();
18         root.show();
19         root.opened();
20         topbar.hide();
21         systemBar.state = "inactive";
22         pageStack.currentPage.mask.state = "dialog";
23     }
24
25     function close() {
26         if(state!="closed") {
27             root.hide();
28             topbar.show();
29             systemBar.state = "active";
30             pageStack.currentPage.mask.state = "idle";
31         }
32     }
33
34     MouseArea {
35         anchors.fill: parent
36         onClicked: {
37             root.canceled();
38             root.close();
39         }
40     }
41 }
42