New GUI
[ubi] / qml / ubi / Page.qml
1 import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
2 import "UIConstants.js" as Const
3 import "components"
4
5 Item {
6     id: root
7     property string title: ""
8     property string orientation: Const.DEFAULT_ORIENTATION
9     property variant menu
10     property alias mask: _mask
11
12     anchors.fill: parent
13
14     Rectangle {
15         anchors.right: parent.right
16         anchors.left: parent.left
17         height: parent.height
18         y: Const.SYSTEM_BAR_HEIGHT
19         color: Const.DEFAULT_BACKGROUND_COLOR
20     }
21
22     Mask {
23         id: _mask
24         z: 100
25         anchors.fill: parent
26         onClicked: taskBar.close()
27     }
28
29     Component.onCompleted: {
30         Utils.setOrientation(orientation);
31         //reloadMenu();
32     }
33
34     /*function reloadMenu() {
35         var buttons = root.menu;
36
37         var menu = taskBar.getMenu();
38         var comp = Qt.createComponent("components/Button.qml");
39
40         var i,l;
41         if(menu.children.length>0) {
42             l = menu.children.length;
43             for(i=0;i<l;++i) {
44                 menu.children[i].destroy();
45             }
46         }
47         if(buttons && buttons.length>0) {
48             l = buttons.length;
49             for(i=0;i<l;++i) {
50                 var obj = comp.createObject(menu);
51                 if (obj==null) {
52                     console.log("Error creating menu Button!");
53                 } else {
54                     var b = buttons[i];
55                     obj.label = b[0];
56                     obj.disabled = b[1];
57                     obj.buttonClicked.connect(function(name){
58                         taskBar.close();
59                         menuFun(name);
60                     });
61                 }
62             }
63         }
64     }*/
65
66     /*SystemBar {
67         z: 100
68         id: systemBar
69         onClicked: {
70             var mask = pageStack.currentPage.mask;
71             if(mask.state=="idle") {
72                 taskBar.open();
73             }
74         }
75     }*/
76 }