0.9.3-1 release
[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     property alias menuFixed: _menuFixed
10     property Flow menuDynamic
11     property bool contexMenu: false
12
13     onOpened: {
14         mask.state = "dialog";
15     }
16     onCanceled: {
17         mask.state = "idle";
18     }
19
20     Line {
21         id: line
22         anchors.top: root.menuDynamic.bottom
23         anchors.topMargin: Const.DEFAULT_MARGIN
24         width: root.width
25         visible: root.contexMenu
26     }
27
28     Flow {
29         id: _menuFixed
30
31         anchors.top: root.contexMenu ? line.bottom : root.menuDynamic.bottom
32         anchors.topMargin: Const.DEFAULT_MARGIN
33
34         x: Const.DEFAULT_MARGIN
35
36         width: root.width-2*Const.DEFAULT_MARGIN
37         spacing: Const.DEFAULT_MARGIN
38
39         Button {
40             label: qsTr("Account");
41             onButtonClicked: {
42                 taskMenu.close();
43                 if(pageStack.currentPage.title!=qsTr("Account")) {
44                     pageStack.push("AccountPage.qml");
45                 }
46             }
47         }
48
49         Button {
50             label: qsTr("Settings");
51             onButtonClicked: {
52                 taskMenu.close();
53                 if(pageStack.currentPage.title!=qsTr("Settings")) {
54                     pageStack.push("SettingsPage.qml");
55                 }
56             }
57         }
58
59         Button {
60             label: qsTr("About Ubi");
61             onButtonClicked: {
62                 taskMenu.close();
63                 aboutDialog.open();
64             }
65         }
66     }
67 }