Add a preference to change LayerView top layers between 1 and 5

Fixes CURA-1643
This commit is contained in:
Arjen Hiemstra 2016-06-02 11:23:18 +02:00
parent 5873f1d4d0
commit 070e791b94
2 changed files with 42 additions and 1 deletions

View file

@ -19,6 +19,7 @@ UM.PreferencesPage
{
UM.Preferences.resetPreference("view/show_overhang");
UM.Preferences.resetPreference("view/center_on_select");
UM.Preferences.resetPreference("view/top_layer_count");
}
Column
@ -57,12 +58,38 @@ UM.PreferencesPage
}
}
UM.TooltipArea {
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip","Displays")
CheckBox
{
id: topLayerCheckbox
text: catalog.i18nc("@action:button","Display five top layers in layer view.");
checked: UM.Preferences.getValue("view/top_layer_count") == 5
onClicked:
{
if(UM.Preferences.getValue("view/top_layer_count") == 5)
{
UM.Preferences.setValue("view/top_layer_count", 1)
}
else
{
UM.Preferences.setValue("view/top_layer_count", 5)
}
}
}
}
Connections {
target: UM.Preferences
onPreferenceChanged:
{
overhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang"))
centerCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select"))
topLayerCheckbox = UM.Preferences.getValue("view/top_layer_count") == 5
}
}
}