From 43ddf7ca238525566e35b40bd4d969b3272e6bcd Mon Sep 17 00:00:00 2001 From: Saracen Date: Thu, 2 May 2019 22:26:33 +0100 Subject: [PATCH 1/2] Unify cube and sphere edit menu entries into one. --- .../resources/qml/hifi/tablet/EditTabView.qml | 16 ++-------------- .../qml/hifi/tablet/EditToolsTabView.qml | 16 ++-------------- scripts/developer/tests/toolbarTest.js | 17 ++++------------- scripts/system/edit.js | 11 +++-------- 4 files changed, 11 insertions(+), 49 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/EditTabView.qml b/interface/resources/qml/hifi/tablet/EditTabView.qml index 5959725a6a..87db317b17 100644 --- a/interface/resources/qml/hifi/tablet/EditTabView.qml +++ b/interface/resources/qml/hifi/tablet/EditTabView.qml @@ -85,23 +85,11 @@ TabBar { NewEntityButton { icon: "icons/create-icons/21-cube-01.svg" - text: "CUBE" + text: "SHAPE" onClicked: { editRoot.sendToScript({ method: "newEntityButtonClicked", - params: { buttonName: "newCubeButton" } - }); - editTabView.currentIndex = 2 - } - } - - NewEntityButton { - icon: "icons/create-icons/22-sphere-01.svg" - text: "SPHERE" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", - params: { buttonName: "newSphereButton" } + params: { buttonName: "newShapeButton" } }); editTabView.currentIndex = 2 } diff --git a/interface/resources/qml/hifi/tablet/EditToolsTabView.qml b/interface/resources/qml/hifi/tablet/EditToolsTabView.qml index 6b64520feb..1f062815b6 100644 --- a/interface/resources/qml/hifi/tablet/EditToolsTabView.qml +++ b/interface/resources/qml/hifi/tablet/EditToolsTabView.qml @@ -91,23 +91,11 @@ TabBar { NewEntityButton { icon: "icons/create-icons/21-cube-01.svg" - text: "CUBE" + text: "SHAPE" onClicked: { editRoot.sendToScript({ method: "newEntityButtonClicked", - params: { buttonName: "newCubeButton" } - }); - editTabView.currentIndex = tabIndex.properties - } - } - - NewEntityButton { - icon: "icons/create-icons/22-sphere-01.svg" - text: "SPHERE" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", - params: { buttonName: "newSphereButton" } + params: { buttonName: "newShapeButton" } }); editTabView.currentIndex = tabIndex.properties } diff --git a/scripts/developer/tests/toolbarTest.js b/scripts/developer/tests/toolbarTest.js index b713445927..89609e610d 100644 --- a/scripts/developer/tests/toolbarTest.js +++ b/scripts/developer/tests/toolbarTest.js @@ -5,8 +5,7 @@ var toolBar = (function() { toolBar, activeButton, newModelButton, - newCubeButton, - newSphereButton, + newShapeButton, newLightButton, newTextButton, newWebButton, @@ -41,20 +40,13 @@ var toolBar = (function() { visible: false }); - newCubeButton = toolBar.addButton({ - objectName: "newCubeButton", + newShapeButton = toolBar.addButton({ + objectName: "newShapeButton", imageURL: toolIconUrl + "cube-01.svg", alpha: 0.9, visible: false }); - newSphereButton = toolBar.addButton({ - objectName: "newSphereButton", - imageURL: toolIconUrl + "sphere-01.svg", - alpha: 0.9, - visible: false - }); - newLightButton = toolBar.addButton({ objectName: "newLightButton", imageURL: toolIconUrl + "light-01.svg", @@ -111,8 +103,7 @@ var toolBar = (function() { // Sets visibility of tool buttons, excluding the power button that.showTools = function(doShow) { newModelButton.writeProperty('visible', doShow); - newCubeButton.writeProperty('visible', doShow); - newSphereButton.writeProperty('visible', doShow); + newShapeButton.writeProperty('visible', doShow); newLightButton.writeProperty('visible', doShow); newTextButton.writeProperty('visible', doShow); newWebButton.writeProperty('visible', doShow); diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 69cf278ab3..77b14d9620 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -860,15 +860,10 @@ var toolBar = (function () { addButton("newModelButton", createNewEntityDialogButtonCallback("Model")); - addButton("newCubeButton", function () { + addButton("newShapeButton", function () { createNewEntity({ - type: "Box", - }); - }); - - addButton("newSphereButton", function () { - createNewEntity({ - type: "Sphere", + type: "Shape", + shape: "Cube", }); }); From fd3c69a905295caf754ce0837bda04e68ecf7aff Mon Sep 17 00:00:00 2001 From: Saracen Date: Thu, 9 May 2019 02:14:00 +0100 Subject: [PATCH 2/2] Replace tabs with spaces. --- scripts/system/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 77b14d9620..371a8d48ca 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -863,7 +863,7 @@ var toolBar = (function () { addButton("newShapeButton", function () { createNewEntity({ type: "Shape", - shape: "Cube", + shape: "Cube", }); });