0.9.3-1 release
[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     Rectangle {
16         id: box
17         width: root.width
18         height: root.height
19         y:3
20         color: Const.TRANSPARENT
21         //color: Const.COOL_GREY_COLOR
22         gradient: Gradient {
23             GradientStop {position: 0.0; color: "#333333"}
24             GradientStop {position: 1.0; color: "#151515"}
25         }
26     }
27
28     Shadow {
29         anchors.bottom: box.top
30     }
31
32     Row {
33         y: 12
34         anchors {horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter}
35         spacing: Const.DEFAULT_MARGIN
36
37         Text {
38             id: title
39             font.pixelSize: 30
40             color: "white"
41             text: pageStack.currentPage.title
42         }
43
44         Image {
45             id: progressIcon
46             source: "images/progress-small.png"
47             anchors.verticalCenter: title.verticalCenter
48             visible: downloadDialog.isActiveDownloads
49             width: 40
50             height: 40
51
52             NumberAnimation {
53                 id: animationIcon
54                 target: progressIcon
55                 properties: "rotation"
56                 from: 0
57                 to: 360
58                 duration: 500
59                 loops: Animation.Infinite
60
61                 Component.onCompleted: animationIcon.start();
62             }
63         }
64     }
65
66     MouseArea {
67         id: mouse
68         height: root.height
69         width: root.height - 2*80
70         anchors.horizontalCenter: root.horizontalCenter
71         onClicked: root.clicked()
72     }
73
74     Button {
75         id: minimizeButton
76         iconSource: pageStack.index > 0 ?  "images/back.png" : "images/close.png"
77         anchors { verticalCenter: parent.verticalCenter; left: parent.left; margins: Const.DEFAULT_MARGIN }
78         onButtonClicked: pageStack.index > 0 ? pageStack.pop() : Qt.quit()
79     }
80
81     /*Button {
82         id: switchButton
83         label: "s"
84         anchors { verticalCenter: parent.verticalCenter; left: minimizeButton.right; margins: Const.DEFAULT_MARGIN }
85         onButtonClicked: {
86             tip.show("ala ma kota, a kot ma Ale bardzo czesto i bardzo dobrze, oooo, tralalal!");
87         }
88     }*/
89
90     Button {
91         id: downloadButton
92         iconSource: "images/upload.png"
93         anchors { verticalCenter: parent.verticalCenter; right: menuButton.left; margins: Const.DEFAULT_MARGIN }
94         onButtonClicked: downloadDialog.open()
95         opacity: downloadDialog.isActiveDownloads ? 1 : 0
96
97         transitions: Transition {
98             NumberAnimation { properties: "opacity"; duration: 600; easing.type: Easing.InOutQuad }
99         }
100     }
101
102     Button {
103         id: menuButton
104         iconSource: "images/options.png"
105         anchors { verticalCenter: parent.verticalCenter; right: parent.right; margins: Const.DEFAULT_MARGIN }
106         onButtonClicked: pageStack.currentPage.taskMenu.open()
107         visible: pageStack.currentPage.taskMenu!=undefined
108     }
109
110     MouseArea {
111         anchors.fill: parent
112         z: -1
113     }
114
115     Rectangle {
116         id: mask
117         anchors.fill: parent
118         color: "black"
119
120         MouseArea {
121             anchors.fill: parent
122             onClicked: root.clickedOnMask()
123         }
124     }
125
126     states: [
127         State {
128             name: "active"
129             PropertyChanges { target: mask; opacity: 0 }
130         },
131         State {
132             name: "inactive"
133             PropertyChanges { target: mask; opacity: 0.6 }
134         }
135     ]
136
137     transitions: Transition {
138         NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }
139     }
140
141 }
142
143
144
145