mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 04:25:56 +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() }
|
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…
x
Reference in New Issue
Block a user