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 overlayShown
35 signal minimizeClicked()
36 signal maximizeClicked()
37 signal maximizeVerticallyClicked()
38 signal maximizeHorizontallyClicked()
42 objectName: "closeWindowButton"
46 onClicked: root.closeClicked()
47 visible: root.closeButtonShown
49 // We dont want touch events to fall through to parent,
50 // otherwise the containsMouse will not work.
53 propagateComposedEvents: true
58 anchors.margins: windowIsMaximized ? units.dp(3) : 0
60 color: theme.palette.normal.negative
61 visible: parent.containsMouse && !overlayShown
65 anchors.margins: windowIsMaximized ? units.dp(6) : units.dp(3)
66 source: "graphics/window-close.svg"
67 color: root.active ? "white" : UbuntuColors.slate
72 id: minimizeWindowButton
73 objectName: "minimizeWindowButton"
77 onClicked: root.minimizeClicked()
79 // We dont want touch events to fall through to parent,
80 // otherwise the containsMouse will not work.
83 propagateComposedEvents: true
88 anchors.margins: windowIsMaximized ? units.dp(3) : 0
90 color: root.active ? UbuntuColors.graphite : UbuntuColors.ash
91 visible: parent.containsMouse && !overlayShown
95 anchors.margins: windowIsMaximized ? units.dp(6) : units.dp(3)
96 source: "graphics/window-minimize.svg"
97 color: root.active ? "white" : UbuntuColors.slate
102 id: maximizeWindowButton
103 objectName: "maximizeWindowButton"
105 height: parent.height
107 visible: root.maximizeButtonShown
108 acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
110 if (mouse.button == Qt.LeftButton) {
111 root.maximizeClicked();
112 } else if (mouse.button == Qt.RightButton) {
113 root.maximizeHorizontallyClicked();
114 } else if (mouse.button == Qt.MiddleButton) {
115 root.maximizeVerticallyClicked();
119 // We dont want touch events to fall through to parent,
120 // otherwise the containsMouse will not work.
123 propagateComposedEvents: true
128 anchors.margins: windowIsMaximized ? units.dp(3) : 0
130 color: root.active ? UbuntuColors.graphite : UbuntuColors.ash
131 visible: parent.containsMouse && !overlayShown
135 anchors.margins: windowIsMaximized ? units.dp(6) : units.dp(3)
136 source: root.windowIsMaximized ? "graphics/window-window.svg" : "graphics/window-maximize.svg"
137 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