mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 16:14:35 +02:00
Made TabletRoot.qml the main tablet qml file.
This file uses a Loader node to load, Tablet.qml.
This commit is contained in:
parent
c4d1bee0e3
commit
856791c11d
4 changed files with 12 additions and 9 deletions
|
@ -7,8 +7,8 @@ Item {
|
||||||
|
|
||||||
property double miclevel: 0.8
|
property double miclevel: 0.8
|
||||||
|
|
||||||
width: 480
|
width: parent.width
|
||||||
height: 720
|
height: parent.height
|
||||||
|
|
||||||
// used to look up a button by its uuid
|
// used to look up a button by its uuid
|
||||||
function findButtonIndex(uuid) {
|
function findButtonIndex(uuid) {
|
||||||
|
@ -171,7 +171,7 @@ Item {
|
||||||
console.log("Tablet.onCompleted!");
|
console.log("Tablet.onCompleted!");
|
||||||
var component = Qt.createComponent("TabletButton.qml");
|
var component = Qt.createComponent("TabletButton.qml");
|
||||||
var buttons = [];
|
var buttons = [];
|
||||||
for (var i = 0; i < 5; i++) {
|
for (var i = 0; i < 6; i++) {
|
||||||
var button = component.createObject(flowMain);
|
var button = component.createObject(flowMain);
|
||||||
button.inDebugMode = true;
|
button.inDebugMode = true;
|
||||||
buttons.push(button);
|
buttons.push(button);
|
||||||
|
|
|
@ -259,9 +259,13 @@ void RenderableWebEntityItem::loadSourceURL() {
|
||||||
_webSurface->load(_sourceUrl, [&](QQmlContext* context, QObject* obj) {});
|
_webSurface->load(_sourceUrl, [&](QQmlContext* context, QObject* obj) {});
|
||||||
|
|
||||||
// TABLET_UI_HACK: move this to overlays as well!
|
// TABLET_UI_HACK: move this to overlays as well!
|
||||||
if (_webSurface->getRootItem() && _webSurface->getRootItem()->objectName() == "tablet") {
|
if (_webSurface->getRootItem() && _webSurface->getRootItem()->objectName() == "tabletRoot") {
|
||||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
auto loader = _webSurface->getRootItem()->findChild<QQuickItem*>("loader");
|
||||||
tabletScriptingInterface->setQmlTablet("com.highfidelity.interface.tablet.system", _webSurface->getRootItem());
|
if (loader) {
|
||||||
|
auto tablet = loader->findChild<QQuickItem*>("tablet");
|
||||||
|
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||||
|
tabletScriptingInterface->setQmlTablet("com.highfidelity.interface.tablet.system", tablet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -363,7 +367,7 @@ void RenderableWebEntityItem::destroyWebSurface() {
|
||||||
QQuickItem* rootItem = _webSurface->getRootItem();
|
QQuickItem* rootItem = _webSurface->getRootItem();
|
||||||
|
|
||||||
// TABLET_UI_HACK: move this to overlays as well!
|
// TABLET_UI_HACK: move this to overlays as well!
|
||||||
if (rootItem && rootItem->objectName() == "tablet") {
|
if (rootItem && rootItem->objectName() == "tabletRoot") {
|
||||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||||
tabletScriptingInterface->setQmlTablet("com.highfidelity.interface.tablet.system", nullptr);
|
tabletScriptingInterface->setQmlTablet("com.highfidelity.interface.tablet.system", nullptr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
tablet.removeButton(button);
|
tablet.removeButton(button);
|
||||||
button.clicked.disconnect(onClicked);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}()); // END LOCAL_SCOPE
|
}()); // END LOCAL_SCOPE
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
function showTabletUI() {
|
function showTabletUI() {
|
||||||
tabletShown = true;
|
tabletShown = true;
|
||||||
print("show tablet-ui");
|
print("show tablet-ui");
|
||||||
UIWebTablet = new WebTablet("qml/hifi/tablet/Tablet.qml", null, null, tabletLocation);
|
UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml", null, null, tabletLocation);
|
||||||
UIWebTablet.register();
|
UIWebTablet.register();
|
||||||
HMD.tabletID = UIWebTablet.webEntityID;
|
HMD.tabletID = UIWebTablet.webEntityID;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue