diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml index 1e471d73f18..a30eb002227 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml @@ -479,48 +479,48 @@ Window { Rectangle { // top controls bar color: "#aa000000" - width: 265 + width: 290 height: btnPerspective.height + 10 anchors.top: parent.top anchors.right: parent.right anchors.rightMargin: 100 - ToggleButton { - id: btnPerspective - anchors.top: parent.top - anchors.topMargin: 5 - anchors.left: parent.left - anchors.leftMargin: 5 - tooltip: qsTr("Toggle Perspective / Orthographic Projection") - states: [{iconId: "ortho", text: qsTr("Orthographic")}, {iconId: "persp", text: qsTr("Perspective")}] + Row { + padding: 5 + anchors.fill: parent + ToggleButton { + id: btnPerspective + width: 105 + tooltip: qsTr("Toggle Perspective / Orthographic Projection") + states: [{iconId: "ortho", text: qsTr("Orthographic")}, {iconId: "persp", text: qsTr("Perspective")}] + } + + ToggleButton { + id: btnLocalGlobal + width: 65 + tooltip: qsTr("Toggle Global / Local Orientation") + states: [{iconId: "local", text: qsTr("Local")}, {iconId: "global", text: qsTr("Global")}] + } + + ToggleButton { + id: btnEditViewLight + width: 110 + toggleBackground: true + tooltip: qsTr("Toggle Edit Light") + states: [{iconId: "edit_light_off", text: qsTr("Edit Light Off")}, {iconId: "edit_light_on", text: qsTr("Edit Light On")}] + } } - ToggleButton { - id: btnLocalGlobal - anchors.top: parent.top - anchors.topMargin: 5 - anchors.left: parent.left - anchors.leftMargin: 100 - tooltip: qsTr("Toggle Global / Local Orientation") - states: [{iconId: "local", text: qsTr("Local")}, {iconId: "global", text: qsTr("Global")}] - } - - ToggleButton { - id: btnEditViewLight - anchors.top: parent.top - anchors.topMargin: 5 - anchors.left: parent.left - anchors.leftMargin: 165 - toggleBackground: true - tooltip: qsTr("Toggle Edit Light") - states: [{iconId: "edit_light_off", text: qsTr("Edit Light Off")}, {iconId: "edit_light_on", text: qsTr("Edit Light On")}] - } } Text { id: helpText + + property string modKey: _generalHelper.isMacOS ? qsTr("Option") : qsTr("Alt") + color: "white" - text: qsTr("Camera controls: ALT + mouse press and drag. Left: Rotate, Middle: Pan, Right/Wheel: Zoom.") + text: qsTr("Camera controls: ") + modKey + + qsTr(" + mouse press and drag. Left: Rotate, Middle: Pan, Right/Wheel: Zoom.") anchors.bottom: parent.bottom } } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp index 84e28ac4ece..74a74d4ba6e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp @@ -222,6 +222,15 @@ QQuick3DNode *GeneralHelper::resolvePick(QQuick3DNode *pickNode) return pickNode; } +bool GeneralHelper::isMacOS() const +{ +#ifdef Q_OS_MACOS + return true; +#else + return false; +#endif +} + } } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h index 890b824aa69..92dc30e1828 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.h @@ -45,6 +45,7 @@ namespace Internal { class GeneralHelper : public QObject { Q_OBJECT + Q_PROPERTY(bool isMacOS READ isMacOS CONSTANT) public: GeneralHelper(); @@ -70,6 +71,8 @@ public: Q_INVOKABLE QQuick3DNode *resolvePick(QQuick3DNode *pickNode); + bool isMacOS() const; + signals: void overlayUpdateNeeded();