1124e06b44ff4a8bd827bcceda18a883d9d6f2c5
[ubi] / qml / ubi / SystemBar.qml
1 import QtQuick 1.0
2 import "components"
3 import "UIConstants.js" as Const
4
5 /* copyright (C) 2010-2012 Stuart Howarth */
6
7 Item {
8     id: root
9
10     height: 60
11     anchors { left: parent.left; right: parent.right; top: parent.top }
12
13     signal clicked()
14
15     Rectangle {
16         width: parent.width
17         height: Const.SYSTEM_BAR_HEIGHT
18         color: "black"
19     }
20
21     Shadow {
22         y: Const.SYSTEM_BAR_HEIGHT
23     }
24
25     Row {
26         y: 12
27         anchors.horizontalCenter: parent.horizontalCenter
28         spacing: Const.DEFAULT_MARGIN
29
30         Text {
31             id: title
32             font.pixelSize: 30
33             color: "white"
34             text: pageStack.currentPage.title
35         }
36
37         Image {
38             source: mouse.pressed? "images/menu-arrow-grey.png" : "images/menu-arrow.png"
39             anchors.verticalCenter: title.verticalCenter
40             visible: !taskBar.isEmpty && !progressIcon.visible
41             width: 18
42             height: 14
43         }
44
45         Image {
46             id: progressIcon
47             source: "images/progress-small.png"
48             anchors.verticalCenter: title.verticalCenter
49             visible: taskBar.isActiveDownloads
50             width: 40
51             height: 40
52
53             NumberAnimation {
54                 id: animationIcon
55                 target: progressIcon
56                 properties: "rotation"
57                 from: 0
58                 to: 360
59                 duration: 500
60                 loops: Animation.Infinite
61
62                 Component.onCompleted: animationIcon.start();
63             }
64         }
65     }
66
67     MouseArea {
68         id: mouse
69         height: root.height
70         width: root.height - 2*80
71         anchors.horizontalCenter: root.horizontalCenter
72         onClicked: root.clicked()
73     }
74
75     /*Rectangle {
76         id: leftSeparator
77
78         width: 1
79         height: 40
80         anchors { left: parent.left; leftMargin: 80; verticalCenter: parent.verticalCenter }
81         color: "white"
82         opacity: 0.5
83     }
84
85     Rectangle {
86         id: rightSeparator
87
88         width: 1
89         height: 40
90         anchors { right: parent.right; rightMargin: 80; verticalCenter: parent.verticalCenter }
91         color: "white"
92         opacity: 0.5
93     }*/
94
95     ToolIcon {
96         id: minimizeButton
97
98         width: 80
99         anchors { verticalCenter: parent.verticalCenter; left: parent.left }
100         iconSource: "images/minimize.png"
101         onClicked: Utils.minimizeWindow()
102     }
103
104     ToolIcon {
105         id: backButton
106
107         width: 80
108         anchors { verticalCenter: parent.verticalCenter; right: parent.right }
109         iconSource: pageStack.index > 0 ?  "images/back.png" : "images/close.png"
110         onClicked: pageStack.index > 0 ? pageStack.pop() : Qt.quit()
111         onPressAndHold: if (pageStack.index > 0) pageStack.clear()
112     }
113
114     MouseArea {
115         anchors.fill: parent
116         z: -1
117     }
118
119 }
120
121
122
123