mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-04 20:11:28 +02:00
fix system toolbar following upgrade to QT 5.6
This commit is contained in:
parent
a40a9f1d73
commit
b918e1ec51
1 changed files with 13 additions and 2 deletions
|
@ -46,8 +46,20 @@ OriginalDesktop.Desktop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property var toolbars: ({})
|
|
||||||
Component { id: toolbarBuilder; Toolbar { } }
|
Component { id: toolbarBuilder; Toolbar { } }
|
||||||
|
// This used to create sysToolbar dynamically with a call to getToolbar() within onCompleted.
|
||||||
|
// Beginning with QT 5.6, this stopped working, as anything added to toolbars too early got
|
||||||
|
// wiped during startup.
|
||||||
|
Toolbar {
|
||||||
|
id: sysToolbar;
|
||||||
|
objectName: "com.highfidelity.interface.toolbar.system";
|
||||||
|
// Magic: sysToolbar.x and y come from settings, and are bound before the properties specified here are applied.
|
||||||
|
x: sysToolbar.x;
|
||||||
|
y: sysToolbar.y;
|
||||||
|
}
|
||||||
|
property var toolbars: (function (map) { // answer dictionary preloaded with sysToolbar
|
||||||
|
map[sysToolbar.objectName] = sysToolbar;
|
||||||
|
return map; })({});
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
WebEngine.settings.javascriptCanOpenWindows = true;
|
WebEngine.settings.javascriptCanOpenWindows = true;
|
||||||
|
@ -55,7 +67,6 @@ OriginalDesktop.Desktop {
|
||||||
WebEngine.settings.spatialNavigationEnabled = false;
|
WebEngine.settings.spatialNavigationEnabled = false;
|
||||||
WebEngine.settings.localContentCanAccessRemoteUrls = true;
|
WebEngine.settings.localContentCanAccessRemoteUrls = true;
|
||||||
|
|
||||||
var sysToolbar = desktop.getToolbar("com.highfidelity.interface.toolbar.system");
|
|
||||||
var toggleHudButton = sysToolbar.addButton({
|
var toggleHudButton = sysToolbar.addButton({
|
||||||
objectName: "hudToggle",
|
objectName: "hudToggle",
|
||||||
imageURL: "../../../icons/hud.svg",
|
imageURL: "../../../icons/hud.svg",
|
||||||
|
|
Loading…
Reference in a new issue