New GUI
[ubi] / qml / ubi / components / DialogBox.qml
index 571aaf2..b72d8aa 100644 (file)
@@ -1,24 +1,34 @@
 import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
 import "../UIConstants.js" as Const
 
-Item {
+Showable {
     id: root
 
+    hidden: true
+    //easingType: Easing.InOutBounce
+
     anchors.left: parent.left; anchors.right: parent.right
-    height: parent.height
-    state: "closed"
+    height: parent.height-Const.SYSTEM_BAR_HEIGHT+Const.SHADOW_OFFSET
 
     signal opened()
     signal canceled()
 
     function open() {
         root.forceActiveFocus();
-        root.state = "opened";
+        root.show();
         root.opened();
+        topbar.hide();
+        systemBar.state = "inactive";
+        pageStack.currentPage.mask.state = "dialog";
     }
 
     function close() {
-        root.state = "closed";
+        if(state!="closed") {
+            root.hide();
+            topbar.show();
+            systemBar.state = "active";
+            pageStack.currentPage.mask.state = "idle";
+        }
     }
 
     MouseArea {
@@ -28,23 +38,5 @@ Item {
             root.close();
         }
     }
-
-    states: [
-        State {
-            name: "opened"
-            PropertyChanges { target: root; opacity: 1 }
-            PropertyChanges { target: root; y: 0}
-        },
-        State {
-            name: "closed"
-            PropertyChanges { target: root; opacity: 0 }
-            PropertyChanges { target: root; y: root.height }
-        }
-    ]
-
-    transitions: Transition {
-        NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }
-        NumberAnimation { properties: "y"; easing.type: Easing.InOutQuad }
-    }
 }