mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:37:58 +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();
|
cameraManager.disable();
|
||||||
selectionDisplay.triggerMapping.disable();
|
selectionDisplay.triggerMapping.disable();
|
||||||
} else {
|
} else {
|
||||||
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
tablet.loadQMLSource("Edit.qml");
|
||||||
UserActivityLogger.enabledEdit();
|
UserActivityLogger.enabledEdit();
|
||||||
entityListTool.setVisible(true);
|
entityListTool.setVisible(true);
|
||||||
gridTool.setVisible(true);
|
gridTool.setVisible(true);
|
||||||
|
@ -1453,12 +1455,8 @@ var PropertiesTool = function (opts) {
|
||||||
// webView.setVisible(visible);
|
// webView.setVisible(visible);
|
||||||
|
|
||||||
that.setVisible = function (newVisible) {
|
that.setVisible = function (newVisible) {
|
||||||
print("PropertiesTool.setVisible --> " + newVisible);
|
|
||||||
visible = newVisible;
|
visible = newVisible;
|
||||||
// webView.setVisible(visible);
|
// webView.setVisible(visible);
|
||||||
if (visible) {
|
|
||||||
webView.loadQMLSource("Edit.qml");
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function updateScriptStatus(info) {
|
function updateScriptStatus(info) {
|
||||||
|
@ -1521,7 +1519,7 @@ var PropertiesTool = function (opts) {
|
||||||
webView.webEventReceived.connect(function (data) {
|
webView.webEventReceived.connect(function (data) {
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
print("--- edit.js webView.webEventReceived ---");
|
print("--- edit.js PropertiesTool webView.webEventReceived ---");
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
print('Edit.js received web event that was not valid json.')
|
print('Edit.js received web event that was not valid json.')
|
||||||
|
|
|
@ -4,9 +4,10 @@ EntityListTool = function(opts) {
|
||||||
var that = {};
|
var that = {};
|
||||||
|
|
||||||
var url = ENTITY_LIST_HTML_URL;
|
var url = ENTITY_LIST_HTML_URL;
|
||||||
var webView = new OverlayWebWindow({
|
var webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
title: 'Entity List', source: url, toolWindow: true
|
// var webView = new OverlayWebWindow({
|
||||||
});
|
// title: 'Entity List', source: url, toolWindow: true
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
var filterInView = false;
|
var filterInView = false;
|
||||||
|
@ -14,13 +15,13 @@ EntityListTool = function(opts) {
|
||||||
|
|
||||||
var visible = false;
|
var visible = false;
|
||||||
|
|
||||||
webView.setVisible(visible);
|
// webView.setVisible(visible);
|
||||||
|
|
||||||
that.webView = webView;
|
that.webView = webView;
|
||||||
|
|
||||||
that.setVisible = function(newVisible) {
|
that.setVisible = function(newVisible) {
|
||||||
visible = newVisible;
|
visible = newVisible;
|
||||||
webView.setVisible(visible);
|
// webView.setVisible(visible);
|
||||||
};
|
};
|
||||||
|
|
||||||
that.toggleVisible = function() {
|
that.toggleVisible = function() {
|
||||||
|
@ -100,6 +101,7 @@ EntityListTool = function(opts) {
|
||||||
|
|
||||||
webView.webEventReceived.connect(function(data) {
|
webView.webEventReceived.connect(function(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
|
print("--- edit.js EntityList webView.webEventReceived ---");
|
||||||
if (data.type == "selectionUpdate") {
|
if (data.type == "selectionUpdate") {
|
||||||
var ids = data.entityIds;
|
var ids = data.entityIds;
|
||||||
var entityIDs = [];
|
var entityIDs = [];
|
||||||
|
@ -149,11 +151,11 @@ EntityListTool = function(opts) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
webView.visibleChanged.connect(function () {
|
// webView.visibleChanged.connect(function () {
|
||||||
if (webView.visible) {
|
// if (webView.visible) {
|
||||||
that.sendUpdate();
|
// that.sendUpdate();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
|
@ -228,10 +228,12 @@ GridTool = function(opts) {
|
||||||
var verticalGrid = opts.verticalGrid;
|
var verticalGrid = opts.verticalGrid;
|
||||||
var listeners = [];
|
var listeners = [];
|
||||||
|
|
||||||
var url = GRID_CONTROLS_HTML_URL;
|
var webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
var webView = new OverlayWebWindow({
|
// var url = GRID_CONTROLS_HTML_URL;
|
||||||
title: 'Grid', source: url, toolWindow: true
|
// var webView = new OverlayWebWindow({
|
||||||
});
|
// title: 'Grid', source: url, toolWindow: true
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
horizontalGrid.addListener(function(data) {
|
horizontalGrid.addListener(function(data) {
|
||||||
webView.emitScriptEvent(JSON.stringify(data));
|
webView.emitScriptEvent(JSON.stringify(data));
|
||||||
|
@ -240,6 +242,7 @@ GridTool = function(opts) {
|
||||||
|
|
||||||
webView.webEventReceived.connect(function(data) {
|
webView.webEventReceived.connect(function(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
|
print("--- edit.js GridTool webView.webEventReceived ---");
|
||||||
if (data.type == "init") {
|
if (data.type == "init") {
|
||||||
horizontalGrid.emitUpdate();
|
horizontalGrid.emitUpdate();
|
||||||
} else if (data.type == "update") {
|
} else if (data.type == "update") {
|
||||||
|
@ -268,7 +271,7 @@ GridTool = function(opts) {
|
||||||
}
|
}
|
||||||
|
|
||||||
that.setVisible = function(visible) {
|
that.setVisible = function(visible) {
|
||||||
webView.setVisible(visible);
|
// webView.setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
|
|
Loading…
Reference in a new issue