New GUI
[ubi] / qml / ubi / TaskMenu.qml
1 import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
2 import "components"
3 import "UIConstants.js" as Const
4
5 DialogBlank {
6     id: root
7
8     property alias menuHeight: root.boxHeight
9
10     property alias menuFixed: _menuFixed
11     property Flow menuDynamic
12
13     property bool contexMenu: false
14
15     onOpened: {
16         mask.state = "dialog";
17     }
18     onCanceled: {
19         mask.state = "idle";
20     }
21
22     Line {
23         id: line
24         anchors.top: root.menuDynamic.bottom
25         anchors.topMargin: Const.DEFAULT_MARGIN
26         width: root.width
27         visible: root.contexMenu
28     }
29
30     Flow {
31         id: _menuFixed
32
33         //y: root.height-root.menuHeight+1*Const.DEFAULT_MARGIN
34
35         anchors.top: root.contexMenu ? line.bottom : root.menuDynamic.bottom
36         anchors.topMargin: Const.DEFAULT_MARGIN
37
38         x: Const.DEFAULT_MARGIN
39
40         width: root.width-2*Const.DEFAULT_MARGIN
41         spacing: Const.DEFAULT_MARGIN
42
43         Button {
44             label: qsTr("Account");
45             onButtonClicked: {
46                 taskMenu.close();
47                 if(pageStack.currentPage.title!=qsTr("Account")) {
48                     pageStack.push("AccountPage.qml");
49                 }
50             }
51         }
52
53         Button {
54             label: qsTr("Settings");
55             onButtonClicked: {
56                 taskMenu.close();
57                 if(pageStack.currentPage.title!=qsTr("Settings")) {
58                     pageStack.push("SettingsPage.qml");
59                 }
60             }
61         }
62
63         Button {
64             label: qsTr("About Ubi");
65             onButtonClicked: {
66                 taskMenu.close();
67                 aboutDialog.open();
68             }
69         }
70     }
71 }