Disable move to mouse position preference in orthogonal view

This commit is contained in:
Ghostkeeper 2019-06-18 11:16:21 +02:00
parent 9236f21d67
commit 7f559987a0
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -368,14 +368,29 @@ UM.PreferencesPage
{ {
width: childrenRect.width; width: childrenRect.width;
height: childrenRect.height; height: childrenRect.height;
text: catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthogonal perspective.")
CheckBox CheckBox
{ {
id: zoomToMouseCheckbox id: zoomToMouseCheckbox
text: catalog.i18nc("@action:button", "Zoom toward mouse direction"); text: catalog.i18nc("@action:button", "Zoom toward mouse direction")
checked: boolCheck(UM.Preferences.getValue("view/zoom_to_mouse")) checked: boolCheck(UM.Preferences.getValue("view/zoom_to_mouse"))
onClicked: UM.Preferences.setValue("view/zoom_to_mouse", checked) onClicked: UM.Preferences.setValue("view/zoom_to_mouse", checked)
enabled: UM.Preferences.getValue("general/camera_perspective_mode") !== "orthogonal"
}
//Because there is no signal for individual preferences, we need to manually link to the onPreferenceChanged signal.
Connections
{
target: UM.Preferences
onPreferenceChanged:
{
if(preference != "general/camera_perspective_mode")
{
return;
}
zoomToMouseCheckbox.enabled = UM.Preferences.getValue("general/camera_perspective_mode") !== "orthogonal";
}
} }
} }