From 65a8582a1ebca50dffc5022eb2c91ee20cd06ada Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 21 May 2019 09:54:32 +0200 Subject: [PATCH] Add preference to set the camera rendering type CURA-5395 --- resources/qml/Preferences/GeneralPage.qml | 54 ++++++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 47cc11632c..dd6004eae0 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -95,6 +95,10 @@ UM.PreferencesPage UM.Preferences.resetPreference("view/top_layer_count"); topLayerCountCheckbox.checked = boolCheck(UM.Preferences.getValue("view/top_layer_count")) + UM.Preferences.resetPreference("general/camera_perspective_mode") + var defaultCameraMode = UM.Preferences.getValue("general/camera_perspective_mode") + setDefaultCameraMode(defaultCameraMode) + UM.Preferences.resetPreference("cura/choice_on_profile_override") setDefaultDiscardOrKeepProfile(UM.Preferences.getValue("cura/choice_on_profile_override")) @@ -330,7 +334,8 @@ UM.PreferencesPage } } - UM.TooltipArea { + UM.TooltipArea + { width: childrenRect.width; height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected") @@ -344,7 +349,8 @@ UM.PreferencesPage } } - UM.TooltipArea { + UM.TooltipArea + { width: childrenRect.width; height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?") @@ -436,6 +442,50 @@ UM.PreferencesPage } } + UM.TooltipArea + { + width: childrenRect.width + height: childrenRect.height + text: catalog.i18nc("@info:tooltip", "What type of camera rendering should be used?") + Column + { + spacing: 4 * screenScaleFactor + + Label + { + text: catalog.i18nc("@window:text", "Camera rendering: ") + } + ComboBox + { + id: cameraComboBox + + model: ListModel + { + id: comboBoxList + + Component.onCompleted: { + append({ text: catalog.i18n("Perspective"), code: "perspective" }) + append({ text: catalog.i18n("Orthogonal"), code: "orthogonal" }) + } + } + + currentIndex: + { + var code = UM.Preferences.getValue("general/camera_perspective_mode"); + for(var i = 0; i < comboBoxList.count; ++i) + { + if(model.get(i).code == code) + { + return i + } + } + return 0 + } + onActivated: UM.Preferences.setValue("general/camera_perspective_mode", model.get(index).code) + } + } + } + Item { //: Spacer