|
|
|
@ -14,6 +14,23 @@ T.Widget {
|
|
|
|
|
signal completed() |
|
|
|
|
signal updated() |
|
|
|
|
|
|
|
|
|
function updateObject(targetObj, sourceObj) { |
|
|
|
|
for (let prop in sourceObj) { |
|
|
|
|
if (sourceObj.hasOwnProperty(prop) && sourceObj[prop] !== undefined) { |
|
|
|
|
if (typeof sourceObj[prop] === 'object') { |
|
|
|
|
Object.assign(targetObj[prop], sourceObj[prop]); |
|
|
|
|
} else { |
|
|
|
|
targetObj[prop] = sourceObj[prop]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return targetObj; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onUpdated: { |
|
|
|
|
widget.settings.styles = updateObject(JSON.parse(JSON.stringify(defaultValues)), widget.settings.styles); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Component.onCompleted: { |
|
|
|
|
if (!widget.settings.styles) { |
|
|
|
|
widget.settings.styles = defaultValues; |
|
|
|
|