Prevent spurious updates to 'onPreferenceChanged's if the preference doesn't match.

This commit is contained in:
Remco Burema 2019-01-15 17:15:12 +01:00
parent c991741a45
commit f057c9a7df
7 changed files with 35 additions and 0 deletions

View file

@ -71,6 +71,11 @@ Item
target: UM.Preferences
onPreferenceChanged:
{
if (preference !== "view/only_show_top_layers" && preference !== "view/top_layer_count" && ! preference.match("layerview/"))
{
return;
}
playButton.pauseSimulation()
}
}

View file

@ -22,6 +22,11 @@ Cura.ExpandableComponent
target: UM.Preferences
onPreferenceChanged:
{
if (preference !== "view/only_show_top_layers" && preference !== "view/top_layer_count" && ! preference.match("layerview/"))
{
return;
}
layerTypeCombobox.currentIndex = UM.SimulationView.compatibilityMode ? 1 : UM.Preferences.getValue("layerview/layer_view_type")
layerTypeCombobox.updateLegends(layerTypeCombobox.currentIndex)
viewSettings.extruder_opacities = UM.Preferences.getValue("layerview/extruder_opacities").split("|")