mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-29 05:41:05 -07:00
Make it easier to override how the settingComboBox updates a setting.
CURA-9793
This commit is contained in:
parent
02572311bf
commit
df8d0e9b46
1 changed files with 11 additions and 5 deletions
|
|
@ -58,13 +58,19 @@ Cura.ComboBox {
|
||||||
function onIsValueUsedChanged() { comboboxModel.updateModel() }
|
function onIsValueUsedChanged() { comboboxModel.updateModel() }
|
||||||
}
|
}
|
||||||
|
|
||||||
onCurrentIndexChanged: updateSetting()
|
onCurrentIndexChanged: parseValueAndUpdateSetting()
|
||||||
|
|
||||||
|
function parseValueAndUpdateSetting()
|
||||||
|
{
|
||||||
|
if (comboboxModel.get(currentIndex) && comboboxModel.get(currentIndex).code != propertyProvider.properties.value)
|
||||||
|
{
|
||||||
|
updateSetting(comboboxModel.get(currentIndex).code)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function updateSetting(value)
|
function updateSetting(value)
|
||||||
{
|
{
|
||||||
if (comboboxModel.get(currentIndex) && comboboxModel.get(currentIndex).code)
|
propertyProvider.setPropertyValue("value", value)
|
||||||
{
|
|
||||||
propertyProvider.setPropertyValue("value", comboboxModel.get(currentIndex).code)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue