2 * Copyright (C) 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
19import Unity.Application 0.1
24 property alias surface: childWindow.surface
25 property real displacementX: 0
26 property real displacementY: 0
27 property alias boundsItem: childWindow.boundsItem
29 x: surface ? surface.position.x + displacementX : 0
30 y: surface ? surface.position.y + displacementY : 0
31 width: childWindow.width
32 height: childWindow.height
35 // API expected by MoveHandler (and some by WindowResizeArea as well)
36 readonly property bool maximized: false
37 readonly property bool maximizedLeft: false
38 readonly property bool maximizedRight: false
39 readonly property bool maximizedHorizontally: false
40 readonly property bool maximizedVertically: false
41 readonly property bool maximizedTopLeft: false
42 readonly property bool maximizedTopRight: false
43 readonly property bool maximizedBottomLeft: false
44 readonly property bool maximizedBottomRight: false
45 readonly property bool anyMaximized: maximized || maximizedLeft || maximizedRight || maximizedHorizontally || maximizedVertically ||
46 maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight
48 readonly property bool canBeCornerMaximized: false
49 readonly property bool canBeMaximizedLeftRight: false
50 readonly property bool canBeMaximized: false
52 readonly property var resizeArea: QtObject {
53 property real normalWidth: units.gu(1)
54 property real normalHeight: units.gu(1)
57 readonly property bool windowedTransitionRunning: false
59 // NB: those bindings will be overwritten by MoveHandler when you first move the window
60 property real windowedX: x
61 property real windowedY: y
64 property real restoredX
65 property real restoredY
68 // end of API expected by MoveHandler
72 // API expected by WindowResizeArea
73 property real windowedWidth: childWindow.width
74 property real windowedHeight: childWindow.height
75 // end of API expected by WindowResizeArea
79 // API expected by WindowControlsOverlay
83 // end of API expected by WindowControlsOverlay
88 when: childWindow.dragging
89 property: "requestedPosition"
90 value: Qt.point(root.windowedX - root.displacementX,
91 root.windowedY - root.displacementY);
94 // It's a separate Item so that a window can be hid independently of its children
98 requestedWidth: root.windowedWidth
99 requestedHeight: root.windowedHeight
105 root.surface.activate();
109 // Using a loader here mainly to circunvent the "ChildWindowTree is instantiated recursively" error from the QML engine
111 id: childRepeaterLoader
112 source: "ChildWindowRepeater.qml"
113 active: root.surface && root.surface.childSurfaceList.count > 0
115 target: childRepeaterLoader.item
116 when: childRepeaterLoader.item
118 value: root.surface ? root.surface.childSurfaceList : null
121 target: childRepeaterLoader.item
122 when: childRepeaterLoader.item
123 property: "boundsItem"
124 value: root.boundsItem
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