@@ -1,5 +1,5 @@
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014-2015 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -12,52 +12,97 @@
13 * You should have received a copy of the GNU General Public License
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16− * Authors: Michael Zanetti <michael.zanetti@canonical.com>
19−import QtQuick 2.3
17+import QtQuick 2.4
20−import Ubuntu.Components 1.1
18+import Ubuntu.Components 1.3
24− spacing: units.gu(0.5)
22+ spacing: units.gu(1)
24+ // to be set from outside
25+ property bool active: false
26 signal close()
27 signal close()
27 signal minimize()
28 signal minimize()
28 signal maximize()
29 signal maximize()
30− Rectangle {
31+ MouseArea {
32+ id: closeWindowButton
31 objectName: "closeWindowButton"
33 objectName: "closeWindowButton"
32− height: parent.height; width: height; radius: height / 2
35+ height: parent.height
33− gradient: Gradient {
36+ width: height
34− GradientStop { color: "#F49073"; position: 0 }
37+ onClicked: root.close()
35− GradientStop { color: "#DF4F1C"; position: 1 }
38+
40+ anchors.centerIn: parent
45+ visible: parent.containsMouse
49+ height: parent.height *.5
50+ anchors.centerIn: parent
51+ source: "graphics/window-close.svg"
52+ color: root.active ? "white" : "#5d5d5d"
37− border.width: units.dp(.5)
38− border.color: "black"
39− MouseArea { anchors.fill: parent; onClicked: root.close() }
58+ id: minimizeWindowButton
42 objectName: "minimizeWindowButton"
59 objectName: "minimizeWindowButton"
43− height: parent.height; width: height; radius: height / 2
61+ height: parent.height
44− gradient: Gradient {
62+ width: height
45− GradientStop { color: "#92918C"; position: 0 }
63+ onClicked: root.minimize()
46− GradientStop { color: "#5E5D58"; position: 1 }
64+
66+ anchors.centerIn: parent
71+ visible: parent.containsMouse
75+ height: parent.height *.5
76+ anchors.centerIn: parent
77+ source: "graphics/window-minimize.svg"
78+ color: root.active ? "white" : "#5d5d5d"
48− border.width: units.dp(.5)
49− border.color: "black"
50− MouseArea { anchors.fill: parent; onClicked: root.minimize() }
84+ id: maximizeWindowButton
53 objectName: "maximizeWindowButton"
85 objectName: "maximizeWindowButton"
54− height: parent.height; width: height; radius: height / 2
87+ height: parent.height
55− gradient: Gradient {
88+ width: height
56− GradientStop { color: "#92918C"; position: 0 }
89+ onClicked: root.maximize()
57− GradientStop { color: "#5E5D58"; position: 1 }
90+
92+ anchors.centerIn: parent
97+ visible: parent.containsMouse
101+ height: parent.height *.5
102+ anchors.centerIn: parent
103+ source: "graphics/window-maximize.svg"
104+ color: root.active ? "white" : "#5d5d5d"
59− border.width: units.dp(.5)
60− border.color: "black"
61− MouseArea { anchors.fill: parent; onClicked: root.maximize() }