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
|
||||
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
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user