Clean up "View" configuration page

Contributes to CURA-211
This commit is contained in:
Arjen Hiemstra 2015-10-08 17:48:22 +02:00
parent d77903871d
commit 9c6c06d501

View File

@ -19,79 +19,51 @@ UM.PreferencesPage
{ {
UM.Preferences.resetPreference("view/show_overhang"); UM.Preferences.resetPreference("view/show_overhang");
UM.Preferences.resetPreference("view/center_on_select"); 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"} UM.I18nCatalog { id: catalog; name:"cura"}
CheckBox
UM.TooltipArea
{ {
id: overhangCheckbox width: childrenRect.width;
checked: boolCheck(UM.Preferences.getValue("view/show_overhang")) height: childrenRect.height;
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
//: Display Overhang preference checkbox text: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will nog print properly.")
text: catalog.i18nc("@option:check","Display Overhang");
onClicked: overhangCheckbox.checked = !overhangCheckbox.checked
//: Display Overhang preference tooltip CheckBox
tooltip: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will nog print properly.")
style: ButtonStyle
{ {
background: Rectangle id: overhangCheckbox
{
border.width: 0 checked: boolCheck(UM.Preferences.getValue("view/show_overhang"))
color: "transparent" onClicked: UM.Preferences.setValue("view/show_overhang", checked)
}
label: Text text: catalog.i18nc("@option:check","Display Overhang");
{
renderType: Text.NativeRendering
horizontalAlignment: Text.AlignLeft
text: control.text
}
} }
} }
CheckBox UM.TooltipArea {
{ width: childrenRect.width;
id: centerCheckbox height: childrenRect.height;
checked: boolCheck(UM.Preferences.getValue("view/center_on_select")) text: catalog.i18nc("@info:tooltip","Moves the camera so the object is in the center of the view when an object is selected")
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
//: Display Overhang preference checkbox 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
{ {
background: Rectangle id: centerCheckbox
{ text: catalog.i18nc("@action:button","Center camera when item is selected");
border.width: 0 checked: boolCheck(UM.Preferences.getValue("view/center_on_select"))
color: "transparent" onClicked: UM.Preferences.setValue("view/center_on_select", checked)
} }
label: Text }
{
renderType: Text.NativeRendering Connections {
horizontalAlignment: Text.AlignLeft target: UM.Preferences
text: control.text 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 }
} }
} }