Unity 8
WindowControlButtons.qml
1 /*
2  * Copyright (C) 2014 Canonical, Ltd.
3  *
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
6  * the Free Software Foundation; version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
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/>.
15  *
16  * Authors: Michael Zanetti <michael.zanetti@canonical.com>
17  */
18 
19 import QtQuick 2.3
20 import Ubuntu.Components 1.1
21 
22 Row {
23  id: root
24  spacing: units.gu(0.5)
25 
26  signal close()
27  signal minimize()
28  signal maximize()
29 
30  Rectangle {
31  height: parent.height; width: height; radius: height / 2
32  gradient: Gradient {
33  GradientStop { color: "#F49073"; position: 0 }
34  GradientStop { color: "#DF4F1C"; position: 1 }
35  }
36  border.width: units.dp(.5)
37  border.color: "black"
38  MouseArea { anchors.fill: parent; onClicked: root.close() }
39  }
40  Rectangle {
41  height: parent.height; width: height; radius: height / 2
42  gradient: Gradient {
43  GradientStop { color: "#92918C"; position: 0 }
44  GradientStop { color: "#5E5D58"; position: 1 }
45  }
46  border.width: units.dp(.5)
47  border.color: "black"
48  MouseArea { anchors.fill: parent; onClicked: root.minimize() }
49  }
50  Rectangle {
51  height: parent.height; width: height; radius: height / 2
52  gradient: Gradient {
53  GradientStop { color: "#92918C"; position: 0 }
54  GradientStop { color: "#5E5D58"; position: 1 }
55  }
56  border.width: units.dp(.5)
57  border.color: "black"
58  MouseArea { anchors.fill: parent; onClicked: root.maximize() }
59  }
60 }