forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -479,48 +479,48 @@ Window {
|
|||||||
|
|
||||||
Rectangle { // top controls bar
|
Rectangle { // top controls bar
|
||||||
color: "#aa000000"
|
color: "#aa000000"
|
||||||
width: 265
|
width: 290
|
||||||
height: btnPerspective.height + 10
|
height: btnPerspective.height + 10
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 100
|
anchors.rightMargin: 100
|
||||||
|
|
||||||
|
Row {
|
||||||
|
padding: 5
|
||||||
|
anchors.fill: parent
|
||||||
ToggleButton {
|
ToggleButton {
|
||||||
id: btnPerspective
|
id: btnPerspective
|
||||||
anchors.top: parent.top
|
width: 105
|
||||||
anchors.topMargin: 5
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: 5
|
|
||||||
tooltip: qsTr("Toggle Perspective / Orthographic Projection")
|
tooltip: qsTr("Toggle Perspective / Orthographic Projection")
|
||||||
states: [{iconId: "ortho", text: qsTr("Orthographic")}, {iconId: "persp", text: qsTr("Perspective")}]
|
states: [{iconId: "ortho", text: qsTr("Orthographic")}, {iconId: "persp", text: qsTr("Perspective")}]
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleButton {
|
ToggleButton {
|
||||||
id: btnLocalGlobal
|
id: btnLocalGlobal
|
||||||
anchors.top: parent.top
|
width: 65
|
||||||
anchors.topMargin: 5
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: 100
|
|
||||||
tooltip: qsTr("Toggle Global / Local Orientation")
|
tooltip: qsTr("Toggle Global / Local Orientation")
|
||||||
states: [{iconId: "local", text: qsTr("Local")}, {iconId: "global", text: qsTr("Global")}]
|
states: [{iconId: "local", text: qsTr("Local")}, {iconId: "global", text: qsTr("Global")}]
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleButton {
|
ToggleButton {
|
||||||
id: btnEditViewLight
|
id: btnEditViewLight
|
||||||
anchors.top: parent.top
|
width: 110
|
||||||
anchors.topMargin: 5
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: 165
|
|
||||||
toggleBackground: true
|
toggleBackground: true
|
||||||
tooltip: qsTr("Toggle Edit Light")
|
tooltip: qsTr("Toggle Edit Light")
|
||||||
states: [{iconId: "edit_light_off", text: qsTr("Edit Light Off")}, {iconId: "edit_light_on", text: qsTr("Edit Light On")}]
|
states: [{iconId: "edit_light_off", text: qsTr("Edit Light Off")}, {iconId: "edit_light_on", text: qsTr("Edit Light On")}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: helpText
|
id: helpText
|
||||||
|
|
||||||
|
property string modKey: _generalHelper.isMacOS ? qsTr("Option") : qsTr("Alt")
|
||||||
|
|
||||||
color: "white"
|
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
|
anchors.bottom: parent.bottom
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -222,6 +222,15 @@ QQuick3DNode *GeneralHelper::resolvePick(QQuick3DNode *pickNode)
|
|||||||
return pickNode;
|
return pickNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GeneralHelper::isMacOS() const
|
||||||
|
{
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -45,6 +45,7 @@ namespace Internal {
|
|||||||
class GeneralHelper : public QObject
|
class GeneralHelper : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(bool isMacOS READ isMacOS CONSTANT)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GeneralHelper();
|
GeneralHelper();
|
||||||
@@ -70,6 +71,8 @@ public:
|
|||||||
Q_INVOKABLE QQuick3DNode *resolvePick(QQuick3DNode *pickNode);
|
Q_INVOKABLE QQuick3DNode *resolvePick(QQuick3DNode *pickNode);
|
||||||
|
|
||||||
|
|
||||||
|
bool isMacOS() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void overlayUpdateNeeded();
|
void overlayUpdateNeeded();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user