fix:TextInput support hot update;feat:add zero color and update
algorithm
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user