mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
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:
parent
5950d147ac
commit
31b7374689
1 changed files with 13 additions and 0 deletions
|
|
@ -47,6 +47,19 @@ TabView
|
||||||
return Math.round(diameter);
|
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
|
Tab
|
||||||
{
|
{
|
||||||
title: catalog.i18nc("@title", "Information")
|
title: catalog.i18nc("@title", "Information")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue