Fix material settings saving upon dialog close

CURA-4606

Force to trigger a lose focus on all editing fields so their
onEditingFinished callback will get triggered.
This commit is contained in:
Lipu Fei 2018-03-06 13:39:35 +01:00
parent 5950d147ac
commit 31b7374689

View file

@ -47,6 +47,19 @@ TabView
return Math.round(diameter);
}
// This trick makes sure to make all fields lose focus so their onEditingFinished will be triggered
// and modified values will be saved. This can happen when a user changes a value and then closes the
// dialog directly.
//
// Please note that somehow this callback is ONLY triggered when visible is false.
onVisibleChanged:
{
if (!visible)
{
base.focus = false;
}
}
Tab
{
title: catalog.i18nc("@title", "Information")