diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/LightGizmo.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/LightGizmo.qml index b8cdafdeb54..9a956c67236 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/LightGizmo.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/LightGizmo.qml @@ -36,7 +36,9 @@ IconGizmo { ? "qrc:///qtquickplugin/mockfiles/images/directional_light_gradient.png" : targetNode instanceof AreaLight ? "qrc:///qtquickplugin/mockfiles/images/area_light_gradient.png" - : "qrc:///qtquickplugin/mockfiles/images/point_light_gradient.png" + : targetNode instanceof PointLight + ? "qrc:///qtquickplugin/mockfiles/images/point_light_gradient.png" + : "qrc:///qtquickplugin/mockfiles/images/spot_light_gradient.png" : "qrc:///qtquickplugin/mockfiles/images/point_light_gradient.png" // ColorOverlay doesn't work correctly with hidden windows so commenting it out for now diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/ToggleButton.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/ToggleButton.qml index a0ebeabbd47..5ecad59a3b0 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/ToggleButton.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/ToggleButton.qml @@ -35,20 +35,13 @@ Rectangle { id: root color: toggleBackground && toggled ? "#aa000000" : mouseArea.containsMouse ? "#44000000" : "#00000000" - width: img.width + txt.width + 5 - height: img.height - - Image { - id: img - anchors.verticalCenter: parent.verticalCenter - source: "qrc:///qtquickplugin/mockfiles/images/" + root.states[toggled ? 1 : 0].iconId + ".png" - } + width: txt.width + 5 + height: 16 Text { id: txt color: "#b5b5b5" anchors.verticalCenter: parent.verticalCenter - anchors.left: img.right text: root.states[toggled ? 1 : 0].text } diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/ToolBarButton.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/ToolBarButton.qml index f3f69cdb0e8..8953559e50e 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/ToolBarButton.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/ToolBarButton.qml @@ -41,8 +41,8 @@ Rectangle { property var _buttonGroupArray: [] id: root - width: img.width + 5 - height: img.height + 5 + width: 16 + height: 16 color: root.selected ? "#aa000000" : (mouseArea.containsMouse ? "#44000000" : "#00000000") radius: 3 @@ -65,13 +65,6 @@ Rectangle { delay: 1000 } - Image { - id: img - anchors.centerIn: parent - source: root.selected ? "qrc:///qtquickplugin/mockfiles/images/" + root.tool + "_selected.png" - : "qrc:///qtquickplugin/mockfiles/images/" + root.tool + "_active.png" - } - Shortcut { sequence: root.currentShortcut onActivated: mouseArea.onClicked(null) diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/directional_light_gradient.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/directional_light_gradient.png index f3c013e157d..c743c54630a 100644 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/directional_light_gradient.png and b/share/qtcreator/qml/qmlpuppet/mockfiles/images/directional_light_gradient.png differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/directional_light_gradient@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/directional_light_gradient@2x.png index 87d60515f50..1ec1148da93 100644 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/directional_light_gradient@2x.png and b/share/qtcreator/qml/qmlpuppet/mockfiles/images/directional_light_gradient@2x.png differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_off.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_off.png deleted file mode 100644 index 73e6e92374b..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_off.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_off@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_off@2x.png deleted file mode 100644 index 5166264e16d..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_off@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_on.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_on.png deleted file mode 100644 index 7660c285460..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_on.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_on@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_on@2x.png deleted file mode 100644 index 836bd2a0d59..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/edit_light_on@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_active.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_active.png deleted file mode 100644 index 056e9ec3c8b..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_active.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_active@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_active@2x.png deleted file mode 100644 index 4b05f83d460..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_active@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_selected.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_selected.png deleted file mode 100644 index b8f98d9f120..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_selected.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_selected@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_selected@2x.png deleted file mode 100644 index eac43612532..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/fit_selected@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/global.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/global.png deleted file mode 100644 index 1bd09c680ac..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/global.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/global@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/global@2x.png deleted file mode 100644 index a2a857fb10c..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/global@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_active.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_active.png deleted file mode 100644 index c5801b34654..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_active.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_active@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_active@2x.png deleted file mode 100644 index 85851c7c130..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_active@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_selected.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_selected.png deleted file mode 100644 index bfb848aa384..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_selected.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_selected@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_selected@2x.png deleted file mode 100644 index f18895dc440..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/group_selection_selected@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_active.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_active.png deleted file mode 100644 index 5fa81302cde..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_active.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_active@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_active@2x.png deleted file mode 100644 index 566da2ef1af..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_active@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_selected.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_selected.png deleted file mode 100644 index 2b685d3d00a..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_selected.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_selected@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_selected@2x.png deleted file mode 100644 index eb0051a606e..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/item_selection_selected@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/light-pick-icon.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/light-pick-icon.png deleted file mode 100644 index b6ac242cbda..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/light-pick-icon.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/light-pick-icon@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/light-pick-icon@2x.png deleted file mode 100644 index d3b041a6043..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/light-pick-icon@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/local.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/local.png deleted file mode 100644 index 0a608f6816e..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/local.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/local@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/local@2x.png deleted file mode 100644 index a5c931e750f..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/local@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_active.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_active.png deleted file mode 100644 index d21d290349c..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_active.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_active@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_active@2x.png deleted file mode 100644 index bd0827f918c..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_active@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_selected.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_selected.png deleted file mode 100644 index 5c8ce42a758..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_selected.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_selected@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_selected@2x.png deleted file mode 100644 index fad362a3e6a..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/move_selected@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/ortho.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/ortho.png deleted file mode 100644 index 35b36203fa2..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/ortho.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/ortho@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/ortho@2x.png deleted file mode 100644 index 443c73e444b..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/ortho@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/persp.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/persp.png deleted file mode 100644 index 9a48e763996..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/persp.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/persp@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/persp@2x.png deleted file mode 100644 index 88a4eab9c6a..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/persp@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_active.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_active.png deleted file mode 100644 index bdabaf30285..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_active.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_active@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_active@2x.png deleted file mode 100644 index 8c81f409d32..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_active@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_selected.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_selected.png deleted file mode 100644 index 42dc2763ce4..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_selected.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_selected@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_selected@2x.png deleted file mode 100644 index b6cc48c0533..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/rotate_selected@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_active.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_active.png deleted file mode 100644 index cd63c1d03bc..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_active.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_active@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_active@2x.png deleted file mode 100644 index 0d95e8e8913..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_active@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_selected.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_selected.png deleted file mode 100644 index 4cca7726170..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_selected.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_selected@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_selected@2x.png deleted file mode 100644 index 690cf5f924f..00000000000 Binary files a/share/qtcreator/qml/qmlpuppet/mockfiles/images/scale_selected@2x.png and /dev/null differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/spot_light_gradient.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/spot_light_gradient.png new file mode 100644 index 00000000000..9bf201f9320 Binary files /dev/null and b/share/qtcreator/qml/qmlpuppet/mockfiles/images/spot_light_gradient.png differ diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/images/spot_light_gradient@2x.png b/share/qtcreator/qml/qmlpuppet/mockfiles/images/spot_light_gradient@2x.png new file mode 100644 index 00000000000..0a4b6b29c75 Binary files /dev/null and b/share/qtcreator/qml/qmlpuppet/mockfiles/images/spot_light_gradient@2x.png differ diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.cpp index 2b9fa903f77..58d1dc40f28 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -115,6 +116,10 @@ void LightGeometry::fillVertexData(QByteArray &vertexData, QByteArray &indexData // and resize later when we know the exact count. vertexSize = int(sizeof(float)) * 3 * pointLightDensity * pointLightDensity * 4; indexSize = int(sizeof(quint16)) * pointLightDensity * pointLightDensity * 4; + } else if (qobject_cast(m_light)) { + // TODO: Spot light model, for now use area light model + vertexSize = int(sizeof(float)) * 3 * dirSegments * 2; + indexSize = int(sizeof(quint16)) * dirSegments * 2 * 2; } vertexData.resize(vertexSize); indexData.resize(indexSize); @@ -181,9 +186,29 @@ void LightGeometry::fillVertexData(QByteArray &vertexData, QByteArray &indexData indexSize += 2 * sizeof(quint16); } } - vertexData.resize(vertexSize); indexData.resize(indexSize); + } else if (qobject_cast(m_light)) { + // TODO: Spot light model, for now use area light model + *dataPtr++ = -1.f; *dataPtr++ = 1.f; *dataPtr++ = 0.f; + *dataPtr++ = -1.f; *dataPtr++ = -1.f; *dataPtr++ = 0.f; + *dataPtr++ = 1.f; *dataPtr++ = -1.f; *dataPtr++ = 0.f; + *dataPtr++ = 1.f; *dataPtr++ = 1.f; *dataPtr++ = 0.f; + + *dataPtr++ = -1.f; *dataPtr++ = 1.f; *dataPtr++ = -1.f; + *dataPtr++ = -1.f; *dataPtr++ = -1.f; *dataPtr++ = -1.f; + *dataPtr++ = 1.f; *dataPtr++ = -1.f; *dataPtr++ = -1.f; + *dataPtr++ = 1.f; *dataPtr++ = 1.f; *dataPtr++ = -1.f; + + *indexPtr++ = 0; *indexPtr++ = 1; + *indexPtr++ = 1; *indexPtr++ = 2; + *indexPtr++ = 2; *indexPtr++ = 3; + *indexPtr++ = 3; *indexPtr++ = 0; + + *indexPtr++ = 0; *indexPtr++ = 4; + *indexPtr++ = 1; *indexPtr++ = 5; + *indexPtr++ = 2; *indexPtr++ = 6; + *indexPtr++ = 3; *indexPtr++ = 7; } static const float floatMin = std::numeric_limits::lowest(); diff --git a/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc b/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc index f9afabee832..0585896fedb 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc +++ b/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc @@ -41,49 +41,13 @@ mockfiles/meshes/axishelper.mesh mockfiles/images/editor_camera.png mockfiles/images/editor_camera@2x.png - mockfiles/images/light-pick-icon.png - mockfiles/images/light-pick-icon@2x.png - mockfiles/images/item_selection_active.png - mockfiles/images/item_selection_active@2x.png - mockfiles/images/item_selection_selected.png - mockfiles/images/item_selection_selected@2x.png - mockfiles/images/group_selection_selected.png - mockfiles/images/group_selection_selected@2x.png - mockfiles/images/group_selection_active.png - mockfiles/images/group_selection_active@2x.png - mockfiles/images/move_active.png - mockfiles/images/move_active@2x.png - mockfiles/images/move_selected.png - mockfiles/images/move_selected@2x.png - mockfiles/images/rotate_active.png - mockfiles/images/rotate_active@2x.png - mockfiles/images/rotate_selected.png - mockfiles/images/rotate_selected@2x.png - mockfiles/images/scale_active.png - mockfiles/images/scale_active@2x.png - mockfiles/images/scale_selected.png - mockfiles/images/scale_selected@2x.png mockfiles/images/directional_light_gradient.png mockfiles/images/directional_light_gradient@2x.png mockfiles/images/point_light_gradient.png mockfiles/images/point_light_gradient@2x.png mockfiles/images/area_light_gradient.png mockfiles/images/area_light_gradient@2x.png - mockfiles/images/fit_active.png - mockfiles/images/fit_active@2x.png - mockfiles/images/fit_selected.png - mockfiles/images/fit_selected@2x.png - mockfiles/images/local.png - mockfiles/images/local@2x.png - mockfiles/images/global.png - mockfiles/images/global@2x.png - mockfiles/images/ortho.png - mockfiles/images/ortho@2x.png - mockfiles/images/persp.png - mockfiles/images/persp@2x.png - mockfiles/images/edit_light_off.png - mockfiles/images/edit_light_off@2x.png - mockfiles/images/edit_light_on.png - mockfiles/images/edit_light_on@2x.png + mockfiles/images/spot_light_gradient.png + mockfiles/images/spot_light_gradient@2x.png