1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-08 03:52:42 +01:00

Add checkbox to monitor settings dialog

This commit is contained in:
Dominik Louven 2020-03-10 20:20:31 +01:00
parent 221b209cf9
commit 9e5fa62382

View File

@ -47,14 +47,49 @@ Item {
var obj = JSON.parse(value.toString())
if (obj["type"] === "slider") {
loader.sourceComponent = compSlider
loader.item.from = obj["from"]
loader.item.to = obj["to"]
loader.item.value = obj["value"]
loader.item.stepSize = obj["stepSize"]
switch(obj["type"]){
case "slider":
loader.sourceComponent = compSlider
loader.item.from = obj["from"]
loader.item.to = obj["to"]
loader.item.value = obj["value"]
loader.item.stepSize = obj["stepSize"]
break;
case "bool":
loader.sourceComponent = compCheckbox
loader.item.value = obj["value"]
break;
}
}
Component{
id: compCheckbox
Item {
id:root
anchors.fill: parent
property bool value
CheckBox {
id: checkbox
checkable: true
checked: root.value
onCheckedChanged: {
var value = checkbox.checked
txtCheckboxValue.text = value;
ScreenPlay.screenPlayManager.setWallpaperValue(selectedMonitor,txtDescription.text,value)
}
}
Text {
id: txtCheckboxValue
anchors{
right:parent.right
verticalCenter: parent.verticalCenter
}
}
}
}
Component {
id: compSlider