mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 13:03:55 +02:00
move the edit tabs into tablet
This commit is contained in:
parent
c4ac719d2c
commit
e12c77e576
4 changed files with 81 additions and 20 deletions
58
interface/resources/qml/hifi/tablet/Edit.qml
Normal file
58
interface/resources/qml/hifi/tablet/Edit.qml
Normal file
|
@ -0,0 +1,58 @@
|
|||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.0
|
||||
import QtWebEngine 1.1
|
||||
import QtWebChannel 1.0
|
||||
import "../../controls"
|
||||
import HFWebEngineProfile 1.0
|
||||
|
||||
Item {
|
||||
id: editRoot
|
||||
property var eventBridge;
|
||||
|
||||
TabView {
|
||||
id: editTabView
|
||||
anchors.fill: parent
|
||||
|
||||
Tab {
|
||||
active: true
|
||||
enabled: true
|
||||
property string originalUrl: ""
|
||||
|
||||
WebView {
|
||||
id: entityListToolWebView
|
||||
url: "../../../../../scripts/system/html/entityList.html"
|
||||
eventBridge: editRoot.eventBridge
|
||||
anchors.fill: parent
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
|
||||
Tab {
|
||||
active: true
|
||||
enabled: true
|
||||
property string originalUrl: ""
|
||||
|
||||
WebView {
|
||||
id: entityPropertiesWebView
|
||||
url: "../../../../../scripts/system/html/entityProperties.html"
|
||||
eventBridge: editRoot.eventBridge
|
||||
anchors.fill: parent
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
|
||||
Tab {
|
||||
active: true
|
||||
enabled: true
|
||||
property string originalUrl: ""
|
||||
|
||||
WebView {
|
||||
id: entityPropertiesWebView
|
||||
url: "../../../../../scripts/system/html/gridControls.html"
|
||||
eventBridge: editRoot.eventBridge
|
||||
anchors.fill: parent
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -482,6 +482,8 @@ var toolBar = (function () {
|
|||
cameraManager.disable();
|
||||
selectionDisplay.triggerMapping.disable();
|
||||
} else {
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
tablet.loadQMLSource("Edit.qml");
|
||||
UserActivityLogger.enabledEdit();
|
||||
entityListTool.setVisible(true);
|
||||
gridTool.setVisible(true);
|
||||
|
@ -1453,12 +1455,8 @@ var PropertiesTool = function (opts) {
|
|||
// webView.setVisible(visible);
|
||||
|
||||
that.setVisible = function (newVisible) {
|
||||
print("PropertiesTool.setVisible --> " + newVisible);
|
||||
visible = newVisible;
|
||||
// webView.setVisible(visible);
|
||||
if (visible) {
|
||||
webView.loadQMLSource("Edit.qml");
|
||||
}
|
||||
};
|
||||
|
||||
function updateScriptStatus(info) {
|
||||
|
@ -1521,7 +1519,7 @@ var PropertiesTool = function (opts) {
|
|||
webView.webEventReceived.connect(function (data) {
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
print("--- edit.js webView.webEventReceived ---");
|
||||
print("--- edit.js PropertiesTool webView.webEventReceived ---");
|
||||
}
|
||||
catch(e) {
|
||||
print('Edit.js received web event that was not valid json.')
|
||||
|
|
|
@ -4,9 +4,10 @@ EntityListTool = function(opts) {
|
|||
var that = {};
|
||||
|
||||
var url = ENTITY_LIST_HTML_URL;
|
||||
var webView = new OverlayWebWindow({
|
||||
title: 'Entity List', source: url, toolWindow: true
|
||||
});
|
||||
var webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
// var webView = new OverlayWebWindow({
|
||||
// title: 'Entity List', source: url, toolWindow: true
|
||||
// });
|
||||
|
||||
|
||||
var filterInView = false;
|
||||
|
@ -14,13 +15,13 @@ EntityListTool = function(opts) {
|
|||
|
||||
var visible = false;
|
||||
|
||||
webView.setVisible(visible);
|
||||
// webView.setVisible(visible);
|
||||
|
||||
that.webView = webView;
|
||||
|
||||
that.setVisible = function(newVisible) {
|
||||
visible = newVisible;
|
||||
webView.setVisible(visible);
|
||||
// webView.setVisible(visible);
|
||||
};
|
||||
|
||||
that.toggleVisible = function() {
|
||||
|
@ -100,6 +101,7 @@ EntityListTool = function(opts) {
|
|||
|
||||
webView.webEventReceived.connect(function(data) {
|
||||
data = JSON.parse(data);
|
||||
print("--- edit.js EntityList webView.webEventReceived ---");
|
||||
if (data.type == "selectionUpdate") {
|
||||
var ids = data.entityIds;
|
||||
var entityIDs = [];
|
||||
|
@ -149,11 +151,11 @@ EntityListTool = function(opts) {
|
|||
}
|
||||
});
|
||||
|
||||
webView.visibleChanged.connect(function () {
|
||||
if (webView.visible) {
|
||||
that.sendUpdate();
|
||||
}
|
||||
});
|
||||
// webView.visibleChanged.connect(function () {
|
||||
// if (webView.visible) {
|
||||
// that.sendUpdate();
|
||||
// }
|
||||
// });
|
||||
|
||||
return that;
|
||||
};
|
||||
|
|
|
@ -228,10 +228,12 @@ GridTool = function(opts) {
|
|||
var verticalGrid = opts.verticalGrid;
|
||||
var listeners = [];
|
||||
|
||||
var url = GRID_CONTROLS_HTML_URL;
|
||||
var webView = new OverlayWebWindow({
|
||||
title: 'Grid', source: url, toolWindow: true
|
||||
});
|
||||
var webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
// var url = GRID_CONTROLS_HTML_URL;
|
||||
// var webView = new OverlayWebWindow({
|
||||
// title: 'Grid', source: url, toolWindow: true
|
||||
// });
|
||||
|
||||
|
||||
horizontalGrid.addListener(function(data) {
|
||||
webView.emitScriptEvent(JSON.stringify(data));
|
||||
|
@ -240,6 +242,7 @@ GridTool = function(opts) {
|
|||
|
||||
webView.webEventReceived.connect(function(data) {
|
||||
data = JSON.parse(data);
|
||||
print("--- edit.js GridTool webView.webEventReceived ---");
|
||||
if (data.type == "init") {
|
||||
horizontalGrid.emitUpdate();
|
||||
} else if (data.type == "update") {
|
||||
|
@ -268,7 +271,7 @@ GridTool = function(opts) {
|
|||
}
|
||||
|
||||
that.setVisible = function(visible) {
|
||||
webView.setVisible(visible);
|
||||
// webView.setVisible(visible);
|
||||
}
|
||||
|
||||
return that;
|
||||
|
|
Loading…
Reference in a new issue