2020-11-27 19:32:49 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
import QtGraphicalEffects 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-11-27 19:32:49 +00:00
|
|
|
import "../../shared"
|
2021-10-14 12:14:11 +00:00
|
|
|
import "../../shared/panels"
|
2020-11-27 19:32:49 +00:00
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: control
|
|
|
|
|
|
|
|
indicator: Rectangle {
|
|
|
|
implicitWidth: 18
|
|
|
|
implicitHeight: 18
|
|
|
|
x: control.leftPadding
|
|
|
|
y: parent.height / 2 - height / 2
|
|
|
|
radius: 3
|
2021-02-18 19:07:23 +00:00
|
|
|
color: (control.down || control.checked) ? Style.current.primary : Style.current.inputBackground
|
2020-11-27 19:32:49 +00:00
|
|
|
|
2021-03-16 19:19:48 +00:00
|
|
|
SVGImage {
|
2021-10-05 20:50:22 +00:00
|
|
|
source: Style.svg("checkmark")
|
2020-11-27 19:32:49 +00:00
|
|
|
width: 16
|
|
|
|
height: 16
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: control.down || control.checked
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: StyledText {
|
|
|
|
text: control.text
|
|
|
|
opacity: enabled ? 1.0 : 0.3
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
2020-12-29 20:33:54 +00:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
width: parent.width
|
2020-11-27 19:32:49 +00:00
|
|
|
leftPadding: !!control.text ? control.indicator.width + control.spacing : control.indicator.width
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|