2 * Copyright (C) 2014-2016 Canonical, Ltd.
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.
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.
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/>.
18import Ubuntu.Components 1.3
22 spacing: overlayShown ? units.gu(2) : windowIsMaximized ? 0 : units.gu(1)
24 UbuntuNumberAnimation {}
27 // to be set from outside
28 property bool active: false
29 property bool windowIsMaximized: false
30 property bool closeButtonShown: true
31 property bool maximizeButtonShown: true
32 property bool minimizeButtonVisible: true
33 property bool overlayShown
36 signal minimizeClicked()
37 signal maximizeClicked()
38 signal maximizeVerticallyClicked()
39 signal maximizeHorizontallyClicked()
43 objectName: "closeWindowButton"
47 onClicked: root.closeClicked()
48 visible: root.closeButtonShown
50 // We dont want touch events to fall through to parent,
51 // otherwise the containsMouse will not work.
54 propagateComposedEvents: true
59 anchors.margins: windowIsMaximized ? units.dp(3) : 0
61 color: theme.palette.normal.negative
62 visible: parent.containsMouse && !overlayShown
66 anchors.margins: windowIsMaximized ? units.dp(6) : units.dp(3)
67 source: "graphics/window-close.svg"
68 color: root.active ? "white" : UbuntuColors.slate
73 id: minimizeWindowButton
74 objectName: "minimizeWindowButton"
78 onClicked: root.minimizeClicked()
79 visible: root.minimizeButtonVisible
81 // We dont want touch events to fall through to parent,
82 // otherwise the containsMouse will not work.
85 propagateComposedEvents: true
90 anchors.margins: windowIsMaximized ? units.dp(3) : 0
92 color: root.active ? UbuntuColors.graphite : UbuntuColors.ash
93 visible: parent.containsMouse && !overlayShown
97 anchors.margins: windowIsMaximized ? units.dp(6) : units.dp(3)
98 source: "graphics/window-minimize.svg"
99 color: root.active ? "white" : UbuntuColors.slate
104 id: maximizeWindowButton
105 objectName: "maximizeWindowButton"
107 height: parent.height
109 visible: root.maximizeButtonShown
110 acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
112 if (mouse.button == Qt.LeftButton) {
113 root.maximizeClicked();
114 } else if (mouse.button == Qt.RightButton) {
115 root.maximizeHorizontallyClicked();
116 } else if (mouse.button == Qt.MiddleButton) {
117 root.maximizeVerticallyClicked();
121 // We dont want touch events to fall through to parent,
122 // otherwise the containsMouse will not work.
125 propagateComposedEvents: true
130 anchors.margins: windowIsMaximized ? units.dp(3) : 0
132 color: root.active ? UbuntuColors.graphite : UbuntuColors.ash
133 visible: parent.containsMouse && !overlayShown
137 anchors.margins: windowIsMaximized ? units.dp(6) : units.dp(3)
138 source: root.windowIsMaximized ? "graphics/window-window.svg" : "graphics/window-maximize.svg"
139 color: root.active ? "white" : UbuntuColors.slate
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list