Lomiri
Loading...
Searching...
No Matches
ShellApplication.qml
1/*
2* Copyright (C) 2016 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
17import QtQuick 2.15
18import QtQml 2.15
19import QtQuick.Window 2.2
20import WindowManager 1.0
21import QtMir.Application 0.1
22
23Instantiator {
24 id: root
25 model: Screens
26
27 ShellScreen {
28 id: window
29 objectName: "screen"+index
30 screen: model.screen
31 screenIndex: index
32 visible: screen != null
33 visibility: applicationArguments.hasFullscreen ? Window.FullScreen : Window.Windowed
34 flags: applicationArguments.hasFrameless ? Qt.FramelessWindowHint : 0
35
36 Binding {
37 when: applicationArguments.hasGeometry
38 target: window
39 restoreMode: Binding.RestoreBinding
40 property: "width"
41 value: applicationArguments.windowGeometry.width
42 }
43 Binding {
44 when: applicationArguments.hasGeometry
45 target: window
46 restoreMode: Binding.RestoreBinding
47 property: "height"
48 value: applicationArguments.windowGeometry.height
49 }
50
51 Component.onCompleted: screen.active = true
52 }
53
54 property var windowManagerSurfaceManagerBinding: Binding {
55 target: WindowManagerObjects
56 restoreMode: Binding.RestoreBinding
57 property: "surfaceManager"
58 value: SurfaceManager
59 }
60 property var windowManagerApplicationManagerBinding: Binding {
61 target: WindowManagerObjects
62 restoreMode: Binding.RestoreBinding
63 property: "applicationManager"
64 value: ApplicationManager
65 }
66
67 Component.onDestruction: {
68 WindowManagerObjects.surfaceManager = null;
69 WindowManagerObjects.applicationManager = null;
70 }
71}