import QtQuick
import QtQuick.Controls
import ZShell.Config
import qs.Services

CheckBox {
	id: control

	property int checkHeight: 20
	property int checkWidth: 20

	contentItem: CustomText {
		anchors.left: parent.left
		anchors.leftMargin: control.checkWidth + control.leftPadding + 8
		anchors.verticalCenter: parent.verticalCenter
		font.pointSize: control.font.pointSize
		text: control.text
	}
	indicator: CustomRect {
		// x: control.leftPadding
		// y: parent.implicitHeight / 2 - implicitHeight / 2
		border.color: control.checked ? Colors.palette.m3primary : "transparent"
		color: Colors.palette.m3surfaceVariant
		implicitHeight: control.checkHeight
		implicitWidth: control.checkWidth
		radius: Tokens.rounding.small / 2

		CustomRect {
			color: Colors.palette.m3primary
			implicitHeight: control.checkHeight - (y * 2)
			implicitWidth: control.checkWidth - (x * 2)
			radius: 3
			visible: control.checked
			x: 4
			y: 4
		}
	}
}
