18
18
import Ubuntu.Components 1.3
19
19
import Unity.Application 0.1
20
20
import "Spread/MathUtils.js" as MathUtils
21
import Unity.ApplicationMenu 0.1
22
import Unity.Indicators 0.1 as Indicators
23
import "../Components/PanelState"
147
150
opacity: root.shadowOpacity
152
closeButtonVisible: root.application.appId !== "unity8-dash"
153
objectName: "appWindowDecoration"
154
anchors { left: parent.left; top: parent.top; right: parent.right }
157
title: applicationWindow.title
158
opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
160
Behavior on opacity { UbuntuNumberAnimation { } }
162
onCloseClicked: root.closeClicked();
163
onMaximizeClicked: { root.decorationPressed(); root.maximizeClicked(); }
164
onMaximizeHorizontallyClicked: { root.decorationPressed(); root.maximizeHorizontallyClicked(); }
165
onMaximizeVerticallyClicked: { root.decorationPressed(); root.maximizeVerticallyClicked(); }
166
onMinimizeClicked: root.minimizeClicked();
167
onPressed: root.decorationPressed();
169
onPressedChanged: moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY)
170
onPositionChanged: moveHandler.handlePositionChanged(mouse)
172
root.decorationReleased();
173
moveHandler.handleReleased();
179
objectName: "moveHandler"
181
buttonsWidth: decoration.buttonsWidth
184
153
ApplicationWindow {
185
154
id: applicationWindow
186
155
objectName: "appWindow"
187
anchors.left: parent.left
188
156
anchors.top: parent.top
189
157
anchors.topMargin: root.decorationHeight * Math.min(1, root.showDecoration)
158
anchors.left: parent.left
190
159
width: implicitWidth
191
160
height: implicitHeight
192
161
requestedHeight: !counterRotate ? root.requestedHeight - d.requestedDecorationHeight : root.requestedWidth
200
anchors { left: parent.left; top: parent.top; right: parent.right }
203
opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
205
Behavior on opacity { UbuntuNumberAnimation { } }
208
drag.filterChildren: true
211
onPressed: root.decorationPressed();
212
onPressedChanged: moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY)
213
onPositionChanged: moveHandler.handlePositionChanged(mouse)
215
root.decorationReleased();
216
moveHandler.handleReleased();
221
closeButtonVisible: root.application.appId !== "unity8-dash"
222
objectName: "appWindowDecoration"
224
title: applicationWindow.title
226
onCloseClicked: root.closeClicked();
227
onMaximizeClicked: { root.decorationPressed(); root.maximizeClicked(); }
228
onMaximizeHorizontallyClicked: { root.decorationPressed(); root.maximizeHorizontallyClicked(); }
229
onMaximizeVerticallyClicked: { root.decorationPressed(); root.maximizeVerticallyClicked(); }
230
onMinimizeClicked: root.minimizeClicked();
235
(PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible)
237
menu: sharedAppModel.model
239
Indicators.SharedUnityMenuModel {
241
property var menus: surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : []
242
property var menuService: menus.length > 0 ? menus[0] : undefined
244
busName: menuService ? menuService.service : ""
245
menuObjectPath: menuService && menuService.menuPath ? menuService.menuPath : ""
246
actions: menuService && menuService.actionPath ? { "unity": menuService.actionPath } : {}
250
target: ApplicationMenuRegistry
251
onSurfaceMenuRegistered: {
252
if (surface && surfaceId === surface.persistentId) {
253
sharedAppModel.menus = Qt.binding(function() { return surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : [] });
256
onSurfaceMenuUnregistered: {
257
if (surface && surfaceId === surface.persistentId) {
258
sharedAppModel.menus = Qt.binding(function() { return surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : [] });
231
266
anchors.fill: applicationWindow
232
267
acceptedButtons: Qt.LeftButton
233
268
property bool dragging: false