Merge pull request #15506 from SaracenOne/unify_primitives

Case 19510: Unify cube and sphere edit menu entries into one.
This commit is contained in:
Brad Hefta-Gaub 2019-05-14 15:31:06 -07:00 committed by GitHub
commit 7440ef3cf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 49 deletions

View file

@ -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
}

View file

@ -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
}

View file

@ -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);

View file

@ -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",
});
});