779.2.2
by Olivier Tilloy
Factor out some common code. |
1 |
/*
|
862.2.7
by Olivier Tilloy
Fix a harmless warning when the webapp container is run with webkit as a rendering engine. |
2 |
* Copyright 2014-2015 Canonical Ltd.
|
779.2.2
by Olivier Tilloy
Factor out some common code. |
3 |
*
|
4 |
* This file is part of webbrowser-app.
|
|
5 |
*
|
|
6 |
* webbrowser-app is free software; you can redistribute it and/or modify
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
8 |
* the Free Software Foundation; version 3.
|
|
9 |
*
|
|
10 |
* webbrowser-app is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17 |
*/
|
|
18 |
||
19 |
import QtQuick 2.0 |
|
20 |
import QtQuick.Window 2.1 |
|
21 |
import Ubuntu.Components 1.1 |
|
22 |
||
23 |
Window { |
|
24 |
id: window
|
|
25 |
||
26 |
property bool developerExtrasEnabled: false |
|
27 |
property bool forceFullscreen: false |
|
28 |
property var currentWebview: null |
|
29 |
||
30 |
contentOrientation: Screen.orientation |
|
31 |
||
32 |
width: 800 |
|
33 |
height: 600 |
|
34 |
||
35 |
QtObject { |
|
36 |
id: internal
|
|
37 |
property int currentWindowState: Window.Windowed |
|
38 |
}
|
|
39 |
||
40 |
Connections { |
|
41 |
target: window.currentWebview |
|
862.2.7
by Olivier Tilloy
Fix a harmless warning when the webapp container is run with webkit as a rendering engine. |
42 |
ignoreUnknownSignals: true |
779.2.2
by Olivier Tilloy
Factor out some common code. |
43 |
onFullscreenChanged: { |
44 |
if (!window.forceFullscreen) { |
|
45 |
if (window.currentWebview.fullscreen) { |
|
46 |
internal.currentWindowState = window.visibility |
|
47 |
window.visibility = Window.FullScreen |
|
48 |
} else { |
|
49 |
window.visibility = internal.currentWindowState |
|
50 |
}
|
|
51 |
}
|
|
52 |
}
|
|
53 |
}
|
|
54 |
}
|