fix:TextInput support hot update;feat:add zero color and update

algorithm
This commit is contained in:
2026-01-29 09:56:10 +08:00
parent db0580ead1
commit 01b988fcd7
22 changed files with 2022 additions and 1452 deletions

View File

@@ -503,11 +503,20 @@ Window {
border.color: root.controlBorder
}
function applyIfValid() {
const c = root.parseHex(text)
if (c) root.syncFromColor(c)
}
onTextEdited: applyIfValid()
onEditingFinished: {
const c = root.parseHex(text)
if (c) root.syncFromColor(c)
else text = root.colorToHexAARRGGBB(root.color)
}
onAccepted: {
applyIfValid()
focus = false
}
}