23258f1d0b26419b83d0fa74e688acf5028ccd61
[ubi] / qml / ubi / SystemBar.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 Item {
6     id: root
7
8     height: Const.SYSTEM_BAR_HEIGHT
9     anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
10     state: "active"
11
12     signal clicked()
13     signal clickedOnMask()
14
15     /*Shadow {
16         id: shadow
17         y:0
18         visible: false
19     }*/
20
21     /*Rectangle {
22         id: bor
23         //color: Const.WARM_GREY_COLOR
24         color: Const.TRANSPARENT
25         height: 1; width: root.width
26         anchors.top: shadow.bottom
27     }*/
28
29     /*Rectangle {
30         id: box
31         width: root.width
32         height: root.height
33         anchors.top: shadow.bottom
34         color: Const.TRANSPARENT
35         //color: Const.COOL_GREY_COLOR
36     }*/
37
38     Row {
39         id: box
40         y: 3
41         Repeater {
42             model: root.width
43             Image {
44                 id: img
45                 source: "images/bg.png"
46             }
47         }
48     }
49
50     Shadow {
51         anchors.bottom: box.top
52     }
53
54     Row {
55         y: 12
56         anchors {horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter}
57         spacing: Const.DEFAULT_MARGIN
58
59         Text {
60             id: title
61             font.pixelSize: 30
62             color: "white"
63             text: pageStack.currentPage.title
64         }
65
66         /*Image {
67             source: mouse.pressed? "images/menu-arrow-grey.png" : "images/menu-arrow.png"
68             anchors.verticalCenter: title.verticalCenter
69             visible: !taskBar.isEmpty && !progressIcon.visible
70             width: 18
71             height: 14
72         }*/
73
74         Image {
75             id: progressIcon
76             source: "images/progress-small.png"
77             anchors.verticalCenter: title.verticalCenter
78             visible: downloadDialog.isActiveDownloads
79             width: 40
80             height: 40
81
82             NumberAnimation {
83                 id: animationIcon
84                 target: progressIcon
85                 properties: "rotation"
86                 from: 0
87                 to: 360
88                 duration: 500
89                 loops: Animation.Infinite
90
91                 Component.onCompleted: animationIcon.start();
92             }
93         }
94     }
95
96     MouseArea {
97         id: mouse
98         height: root.height
99         width: root.height - 2*80
100         anchors.horizontalCenter: root.horizontalCenter
101         onClicked: root.clicked()
102     }
103
104     /*Rectangle {
105         id: leftSeparator
106
107         width: 1
108         height: 40
109         anchors { left: parent.left; leftMargin: 80; verticalCenter: parent.verticalCenter }
110         color: "white"
111         opacity: 0.5
112     }
113
114     Rectangle {
115         id: rightSeparator
116
117         width: 1
118         height: 40
119         anchors { right: parent.right; rightMargin: 80; verticalCenter: parent.verticalCenter }
120         color: "white"
121         opacity: 0.5
122     }*/
123
124     /*ToolIcon {
125         id: minimizeButton
126
127         width: 80
128         anchors { verticalCenter: parent.verticalCenter; left: parent.left }
129         iconSource: "images/minimize.png"
130         onClicked: Utils.minimizeWindow()
131     }*/
132
133     Button {
134         id: minimizeButton
135         iconSource: pageStack.index > 0 ?  "images/back.png" : "images/close.png"
136         anchors { verticalCenter: parent.verticalCenter; left: parent.left; margins: Const.DEFAULT_MARGIN }
137         onButtonClicked: pageStack.index > 0 ? pageStack.pop() : Qt.quit()
138     }
139
140     /*Button {
141         id: switchButton
142         label: "s"
143         anchors { verticalCenter: parent.verticalCenter; left: minimizeButton.right; margins: Const.DEFAULT_MARGIN }
144         onButtonClicked: {
145             tip.show("ala ma kota, a kot ma Ale bardzo czesto i bardzo dobrze, oooo, tralalal!");
146         }
147     }*/
148
149     Button {
150         id: downloadButton
151         iconSource: "images/upload.png"
152         anchors { verticalCenter: parent.verticalCenter; right: menuButton.left; margins: Const.DEFAULT_MARGIN }
153         onButtonClicked: downloadDialog.open()
154         opacity: downloadDialog.isActiveDownloads ? 1 : 0
155
156         transitions: Transition {
157             NumberAnimation { properties: "opacity"; duration: 600; easing.type: Easing.InOutQuad }
158         }
159     }
160
161     Button {
162         id: menuButton
163         iconSource: "images/options.png"
164         anchors { verticalCenter: parent.verticalCenter; right: parent.right; margins: Const.DEFAULT_MARGIN }
165         onButtonClicked: pageStack.currentPage.taskMenu.open()
166         visible: pageStack.currentPage.taskMenu!=undefined
167     }
168
169     MouseArea {
170         anchors.fill: parent
171         z: -1
172     }
173
174     Rectangle {
175         id: mask
176         anchors.fill: parent
177         color: "black"
178
179         MouseArea {
180             anchors.fill: parent
181             onClicked: root.clickedOnMask()
182         }
183     }
184
185     states: [
186         State {
187             name: "active"
188             PropertyChanges { target: mask; opacity: 0 }
189         },
190         State {
191             name: "inactive"
192             PropertyChanges { target: mask; opacity: 0.6 }
193         }
194     ]
195
196     transitions: Transition {
197         NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }
198     }
199
200 }
201
202
203
204