Meshroom/meshroom/ui/qml/Charts/ChartViewCheckBox.qml
2023-07-03 12:11:29 +02:00

34 lines
826 B
QML

import QtQuick 2.15
import QtQuick.Controls 2.15
/**
* A custom CheckBox designed to be used in ChartView's legend.
*/
CheckBox {
id: root
property color color
leftPadding: 0
font.pointSize: 8
indicator: Rectangle {
width: 11
height: width
border.width: 1
border.color: root.color
color: "transparent"
anchors.verticalCenter: parent.verticalCenter
Rectangle {
anchors.fill: parent
anchors.margins: parent.border.width + 1
visible: parent.parent.checkState != Qt.Unchecked
anchors.topMargin: parent.parent.checkState === Qt.PartiallyChecked ? 5 : 2
anchors.bottomMargin: anchors.topMargin
color: parent.border.color
anchors.centerIn: parent
}
}
}