From 9c6c06d501bc5ed01528ca8ce0ea449ca19dd31e Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 8 Oct 2015 17:48:22 +0200 Subject: [PATCH] Clean up "View" configuration page Contributes to CURA-211 --- resources/qml/ViewPage.qml | 90 +++++++++++++------------------------- 1 file changed, 31 insertions(+), 59 deletions(-) diff --git a/resources/qml/ViewPage.qml b/resources/qml/ViewPage.qml index 37a5024375..7b33345a9a 100644 --- a/resources/qml/ViewPage.qml +++ b/resources/qml/ViewPage.qml @@ -19,79 +19,51 @@ UM.PreferencesPage { UM.Preferences.resetPreference("view/show_overhang"); UM.Preferences.resetPreference("view/center_on_select"); - overhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang")) - centerCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select")) } - GridLayout + Column { - columns: 2; UM.I18nCatalog { id: catalog; name:"cura"} - CheckBox + + UM.TooltipArea { - id: overhangCheckbox - checked: boolCheck(UM.Preferences.getValue("view/show_overhang")) - onCheckedChanged: UM.Preferences.setValue("view/show_overhang", checked ? "True" : "False") - } - Button - { - id: viewText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox + width: childrenRect.width; + height: childrenRect.height; - //: Display Overhang preference checkbox - text: catalog.i18nc("@option:check","Display Overhang"); - onClicked: overhangCheckbox.checked = !overhangCheckbox.checked + text: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will nog print properly.") - //: Display Overhang preference tooltip - tooltip: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will nog print properly.") - - style: ButtonStyle + CheckBox { - background: Rectangle - { - border.width: 0 - color: "transparent" - } - label: Text - { - renderType: Text.NativeRendering - horizontalAlignment: Text.AlignLeft - text: control.text - } + id: overhangCheckbox + + checked: boolCheck(UM.Preferences.getValue("view/show_overhang")) + onClicked: UM.Preferences.setValue("view/show_overhang", checked) + + text: catalog.i18nc("@option:check","Display Overhang"); } } - CheckBox - { - id: centerCheckbox - checked: boolCheck(UM.Preferences.getValue("view/center_on_select")) - onCheckedChanged: UM.Preferences.setValue("view/center_on_select", checked ? "True" : "False") - } - Button - { - id: centerText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox + UM.TooltipArea { + width: childrenRect.width; + height: childrenRect.height; + text: catalog.i18nc("@info:tooltip","Moves the camera so the object is in the center of the view when an object is selected") - //: Display Overhang preference checkbox - text: catalog.i18nc("@action:button","Center camera when item is selected"); - onClicked: centerCheckbox.checked = !centerCheckbox.checked - - //: Display Overhang preference tooltip - tooltip: catalog.i18nc("@info:tooltip","Moves the camera so the object is in the center of the view when an object is selected") - - style: ButtonStyle + CheckBox { - background: Rectangle - { - border.width: 0 - color: "transparent" - } - label: Text - { - renderType: Text.NativeRendering - horizontalAlignment: Text.AlignLeft - text: control.text - } + id: centerCheckbox + text: catalog.i18nc("@action:button","Center camera when item is selected"); + checked: boolCheck(UM.Preferences.getValue("view/center_on_select")) + onClicked: UM.Preferences.setValue("view/center_on_select", checked) + } + } + + Connections { + target: UM.Preferences + onPreferenceChanged: + { + overhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang")) + centerCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select")) } } - Item { Layout.fillHeight: true; Layout.columnSpan: 2 } } }