28 lines
533 B
QML
28 lines
533 B
QML
|
// SPDX-License-Identifier: Unlicense
|
||
|
|
||
|
import QtQuick 2.12
|
||
|
import QtQuick.Controls 2.13
|
||
|
|
||
|
Row {
|
||
|
id: control
|
||
|
width: parent.width
|
||
|
|
||
|
property var definition
|
||
|
property alias value: input.checked
|
||
|
|
||
|
Keys.onPressed: {
|
||
|
if (event.text === definition.key) {
|
||
|
value = !value
|
||
|
event.accepted = true
|
||
|
}
|
||
|
}
|
||
|
function set(val) { value = val || false }
|
||
|
|
||
|
CheckBox {
|
||
|
id: input
|
||
|
focusPolicy: Qt.NoFocus
|
||
|
padding: 0
|
||
|
font.capitalization: Font.SmallCaps
|
||
|
}
|
||
|
}
|