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