mirror of
https://github.com/overte-org/overte.git
synced 2025-04-09 10:45:24 +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
|
||||
|
||||
width: 480
|
||||
height: 720
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
// used to look up a button by its uuid
|
||||
function findButtonIndex(uuid) {
|
||||
|
@ -171,7 +171,7 @@ Item {
|
|||
console.log("Tablet.onCompleted!");
|
||||
var component = Qt.createComponent("TabletButton.qml");
|
||||
var buttons = [];
|
||||
for (var i = 0; i < 5; i++) {
|
||||
for (var i = 0; i < 6; i++) {
|
||||
var button = component.createObject(flowMain);
|
||||
button.inDebugMode = true;
|
||||
buttons.push(button);
|
||||
|
|
|
@ -259,9 +259,13 @@ void RenderableWebEntityItem::loadSourceURL() {
|
|||
_webSurface->load(_sourceUrl, [&](QQmlContext* context, QObject* obj) {});
|
||||
|
||||
// TABLET_UI_HACK: move this to overlays as well!
|
||||
if (_webSurface->getRootItem() && _webSurface->getRootItem()->objectName() == "tablet") {
|
||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||
tabletScriptingInterface->setQmlTablet("com.highfidelity.interface.tablet.system", _webSurface->getRootItem());
|
||||
if (_webSurface->getRootItem() && _webSurface->getRootItem()->objectName() == "tabletRoot") {
|
||||
auto loader = _webSurface->getRootItem()->findChild<QQuickItem*>("loader");
|
||||
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();
|
||||
|
||||
// TABLET_UI_HACK: move this to overlays as well!
|
||||
if (rootItem && rootItem->objectName() == "tablet") {
|
||||
if (rootItem && rootItem->objectName() == "tabletRoot") {
|
||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||
tabletScriptingInterface->setQmlTablet("com.highfidelity.interface.tablet.system", nullptr);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
Script.scriptEnding.connect(function () {
|
||||
tablet.removeButton(button);
|
||||
button.clicked.disconnect(onClicked);
|
||||
});
|
||||
|
||||
}()); // END LOCAL_SCOPE
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
function showTabletUI() {
|
||||
tabletShown = true;
|
||||
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();
|
||||
HMD.tabletID = UIWebTablet.webEntityID;
|
||||
|
||||
|
|
Loading…
Reference in a new issue