diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-12-13 15:28:15 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-12-13 14:44:23 +0000 |
commit | 82f2667ab390bab7785d6f62d12824701195bb35 (patch) | |
tree | 1799c8882cd8234ab612c329ab0feea8b73d7f06 | |
parent | f97de35dd4af80fa5f3d4229ac4aa8519d9e1d38 (diff) | |
download | qt-creator-82f2667ab390bab7785d6f62d12824701195bb35.tar.gz |
QmlDesigner: Fix minor edit 3D view ui issues in mac
Change-Id: Ia86b5f828d147ca0c3593da7f7dcb77696fdeead
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
3 files changed, 41 insertions, 29 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml index 1e471d73f1..a30eb00222 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 - 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: btnLocalGlobal + width: 65 + 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")}] + 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")}] + } } + } 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 84e28ac4ec..74a74d4ba6 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 890b824aa6..92dc30e182 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(); |