blob: 7f1e6f5d4618ff5deabc6bd98f35833639b6d145 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick 2.15
import StudioControls 1.0 as StudioControls
StudioControls.CheckBox {
id: checkBox
property variant backendValue
property string tooltip
ExtendedFunctionLogic {
id: extFuncLogic
backendValue: checkBox.backendValue
}
actionIndicator.icon.color: extFuncLogic.color
actionIndicator.icon.text: extFuncLogic.glyph
actionIndicator.onClicked: extFuncLogic.show()
actionIndicator.forceVisible: extFuncLogic.menuVisible
labelColor: colorLogic.textColor
property bool __block: false
ColorLogic {
id: colorLogic
backendValue: checkBox.backendValue
onValueFromBackendChanged: {
checkBox.__block = true
if (colorLogic.valueFromBackend !== undefined
&& checkBox.checked !== colorLogic.valueFromBackend)
checkBox.checked = colorLogic.valueFromBackend
checkBox.__block = false
}
}
onCheckedChanged: {
if (checkBox.__block)
return
if (backendValue.value !== checkBox.checked)
backendValue.value = checkBox.checked
}
}
|