aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2020-06-29 16:24:07 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2020-06-29 13:30:07 +0000
commit38ded4ffeaea725215a693eb0da1aacbc386cde7 (patch)
treedbec9df2c65f7004f5db64e99eb8f981ac10bae0 /share
parent28c6457b8cbb992542d559bc3897646458fbe245 (diff)
QmlDesigner: Turn the 3D edit light on initially for lightless scenes
Change-Id: Ib840adec751604f08b5135b3e3088b7ce663685a Fixes: QDS-2316 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml16
1 files changed, 14 insertions, 2 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml
index 643b377e8b3..efbfcd56421 100644
--- a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml
+++ b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml
@@ -107,10 +107,22 @@ Item {
if (createEditView()) {
if (activeScene) {
var toolStates = _generalHelper.getToolStates(sceneId);
- if (Object.keys(toolStates).length > 0)
+ if (Object.keys(toolStates).length > 0) {
updateToolStates(toolStates, true);
- else
+ } else {
+ // Don't inherit the edit light state from the previous scene, but rather
+ // turn the edit light on for scenes that do not have any scene
+ // lights, and turn it off for scenes that have.
+ var hasSceneLight = false;
+ for (var i = 0; i < lightIconGizmos.length; ++i) {
+ if (lightIconGizmos[i].scene === activeScene) {
+ hasSceneLight = true;
+ break;
+ }
+ }
+ showEditLight = !hasSceneLight;
storeCurrentToolStates();
+ }
} else {
// When active scene is deleted, this function gets called by object deletion
// handlers without going through setActiveScene, so make sure sceneId is cleared.