handle tint color for on, off & thumb
This commit is contained in:
@@ -1,6 +1,35 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.5
|
||||
|
||||
Switch {
|
||||
import "util.mjs" as Util
|
||||
|
||||
Switch {
|
||||
property var wrapper
|
||||
|
||||
property var uuid: Util.uuidv4()
|
||||
|
||||
property var tag: "Switch"
|
||||
|
||||
property var offTintColor: "#42000000"
|
||||
property var onTintColor: "#00ff00"
|
||||
property var thumbTintColor: "white"
|
||||
|
||||
Component.onCompleted: {
|
||||
this.indicator.children[1].color = thumbTintColor
|
||||
}
|
||||
|
||||
onThumbTintColorChanged: {
|
||||
this.indicator.children[1].color = thumbTintColor
|
||||
}
|
||||
|
||||
onCheckedChanged: {
|
||||
console.log(onTintColor)
|
||||
console.log(offTintColor)
|
||||
console.log(thumbTintColor)
|
||||
if (checked) {
|
||||
this.indicator.children[0].color = onTintColor
|
||||
} else {
|
||||
this.indicator.children[0].color = offTintColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user