New GUI
[ubi] / qml / ubi / TaskMenu.qml
diff --git a/qml/ubi/TaskMenu.qml b/qml/ubi/TaskMenu.qml
new file mode 100644 (file)
index 0000000..1808156
--- /dev/null
@@ -0,0 +1,71 @@
+import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import "components"
+import "UIConstants.js" as Const
+
+DialogBlank {
+    id: root
+
+    property alias menuHeight: root.boxHeight
+
+    property alias menuFixed: _menuFixed
+    property Flow menuDynamic
+
+    property bool contexMenu: false
+
+    onOpened: {
+        mask.state = "dialog";
+    }
+    onCanceled: {
+        mask.state = "idle";
+    }
+
+    Line {
+        id: line
+        anchors.top: root.menuDynamic.bottom
+        anchors.topMargin: Const.DEFAULT_MARGIN
+        width: root.width
+        visible: root.contexMenu
+    }
+
+    Flow {
+        id: _menuFixed
+
+        //y: root.height-root.menuHeight+1*Const.DEFAULT_MARGIN
+
+        anchors.top: root.contexMenu ? line.bottom : root.menuDynamic.bottom
+        anchors.topMargin: Const.DEFAULT_MARGIN
+
+        x: Const.DEFAULT_MARGIN
+
+        width: root.width-2*Const.DEFAULT_MARGIN
+        spacing: Const.DEFAULT_MARGIN
+
+        Button {
+            label: qsTr("Account");
+            onButtonClicked: {
+                taskMenu.close();
+                if(pageStack.currentPage.title!=qsTr("Account")) {
+                    pageStack.push("AccountPage.qml");
+                }
+            }
+        }
+
+        Button {
+            label: qsTr("Settings");
+            onButtonClicked: {
+                taskMenu.close();
+                if(pageStack.currentPage.title!=qsTr("Settings")) {
+                    pageStack.push("SettingsPage.qml");
+                }
+            }
+        }
+
+        Button {
+            label: qsTr("About Ubi");
+            onButtonClicked: {
+                taskMenu.close();
+                aboutDialog.open();
+            }
+        }
+    }
+}