mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 11:55:54 +08:00
Make it easier to override how the settingComboBox updates a setting.
CURA-9793
This commit is contained in:
parent
02572311bf
commit
df8d0e9b46
@ -58,13 +58,19 @@ Cura.ComboBox {
|
||||
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)
|
||||
{
|
||||
if (comboboxModel.get(currentIndex) && comboboxModel.get(currentIndex).code)
|
||||
{
|
||||
propertyProvider.setPropertyValue("value", comboboxModel.get(currentIndex).code)
|
||||
}
|
||||
propertyProvider.setPropertyValue("value", value)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user