@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014-2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -12,52 +12,97 @@
1212 *
1313 * You should have received a copy of the GNU General Public License
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors: Michael Zanetti <michael.zanetti@canonical.com>
1715 */
1816
19−import QtQuick 2.3
20−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
2119
2220Row {
2321 id: root
24− spacing: units.gu(0.5)
22+ spacing: units.gu(1)
23+
24+ // to be set from outside
25+ property bool active: false
2526
2627 signal close()
2728 signal minimize()
2829 signal maximize()
2930
30− Rectangle {
31+ MouseArea {
32+ id: closeWindowButton
3133 objectName: "closeWindowButton"
32− height: parent.height; width: height; radius: height / 2
33− gradient: Gradient {
34− GradientStop { color: "#F49073"; position: 0 }
35− GradientStop { color: "#DF4F1C"; position: 1 }
34+ hoverEnabled: true
35+ height: parent.height
36+ width: height
37+ onClicked: root.close()
38+
39+ Rectangle {
40+ anchors.centerIn: parent
41+ width: units.gu(2)
42+ height: units.gu(2)
43+ radius: height / 2
44+ color: "#ed3146"
45+ visible: parent.containsMouse
46+ }
47+ Icon {
48+ width: height
49+ height: parent.height *.5
50+ anchors.centerIn: parent
51+ source: "graphics/window-close.svg"
52+ color: root.active ? "white" : "#5d5d5d"
53+ keyColor: "black"
3654 }
37− border.width: units.dp(.5)
38− border.color: "black"
39− MouseArea { anchors.fill: parent; onClicked: root.close() }
4055 }
41− Rectangle {
56+
57+ MouseArea {
58+ id: minimizeWindowButton
4259 objectName: "minimizeWindowButton"
43− height: parent.height; width: height; radius: height / 2
44− gradient: Gradient {
45− GradientStop { color: "#92918C"; position: 0 }
46− GradientStop { color: "#5E5D58"; position: 1 }
60+ hoverEnabled: true
61+ height: parent.height
62+ width: height
63+ onClicked: root.minimize()
64+
65+ Rectangle {
66+ anchors.centerIn: parent
67+ width: units.gu(2)
68+ height: units.gu(2)
69+ radius: height / 2
70+ color: "#888888"
71+ visible: parent.containsMouse
72+ }
73+ Icon {
74+ width: height
75+ height: parent.height *.5
76+ anchors.centerIn: parent
77+ source: "graphics/window-minimize.svg"
78+ color: root.active ? "white" : "#5d5d5d"
79+ keyColor: "black"
4780 }
48− border.width: units.dp(.5)
49− border.color: "black"
50− MouseArea { anchors.fill: parent; onClicked: root.minimize() }
5181 }
52− Rectangle {
82+
83+ MouseArea {
84+ id: maximizeWindowButton
5385 objectName: "maximizeWindowButton"
54− height: parent.height; width: height; radius: height / 2
55− gradient: Gradient {
56− GradientStop { color: "#92918C"; position: 0 }
57− GradientStop { color: "#5E5D58"; position: 1 }
86+ hoverEnabled: true
87+ height: parent.height
88+ width: height
89+ onClicked: root.maximize()
90+
91+ Rectangle {
92+ anchors.centerIn: parent
93+ width: units.gu(2)
94+ height: units.gu(2)
95+ radius: height / 2
96+ color: "#888888"
97+ visible: parent.containsMouse
98+ }
99+ Icon {
100+ width: height
101+ height: parent.height *.5
102+ anchors.centerIn: parent
103+ source: "graphics/window-maximize.svg"
104+ color: root.active ? "white" : "#5d5d5d"
105+ keyColor: "black"
58106 }
59− border.width: units.dp(.5)
60− border.color: "black"
61− MouseArea { anchors.fill: parent; onClicked: root.maximize() }
62107 }
63108}