summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/TemplateCheckBox.qml
blob: 85aa0bef198cbdd9a6f4e3015a767bc9faf97cc1 (plain) (blame)
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
// SPDX-License-Identifier: GPL-2.0
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.11
import org.kde.kirigami 2.4 as Kirigami

CheckBox {
	id: cb

	indicator: Rectangle {
		implicitWidth: Kirigami.Units.gridUnit
		implicitHeight: Kirigami.Units.gridUnit
		x: cb.leftPadding
		y: parent.height / 2 - height / 2
		radius: 3
		color: subsurfaceTheme.backgroundColor
		border.color: subsurfaceTheme.textColor

		Rectangle {
			width: parent.width / 2
			height: width
			x: width / 2
			y: width / 2
			radius: 2
			color: subsurfaceTheme.textColor
			visible: cb.checked
		}
	}
	contentItem: Text {
		color: subsurfaceTheme.textColor
		font.pointSize: subsurfaceTheme.regularPointSize
		text: cb.text
		leftPadding: cb.indicator.width + cb.spacing
	}
}