From 7f559987a03a8c968cb3db9a468b8931013adfa3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Jun 2019 11:16:21 +0200 Subject: [PATCH] Disable move to mouse position preference in orthogonal view --- resources/qml/Preferences/GeneralPage.qml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index dd6004eae0..923d32246f 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -368,14 +368,29 @@ UM.PreferencesPage { width: childrenRect.width; 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 { 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")) 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"; + } } }