aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/CheckBox.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/CheckBox.qml')
-rw-r--r--src/imports/controls/CheckBox.qml44
1 files changed, 33 insertions, 11 deletions
diff --git a/src/imports/controls/CheckBox.qml b/src/imports/controls/CheckBox.qml
index 4da79098..ec539b19 100644
--- a/src/imports/controls/CheckBox.qml
+++ b/src/imports/controls/CheckBox.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.9
-import QtQuick.Templates 2.2 as T
-import QtQuick.Controls 2.2
-import QtQuick.Controls.impl 2.2
+import QtQuick 2.10
+import QtQuick.Templates 2.3 as T
+import QtQuick.Controls 2.3
+import QtQuick.Controls.impl 2.3
T.CheckBox {
id: control
@@ -52,21 +52,43 @@ T.CheckBox {
padding: 6
spacing: 6
- indicator: CheckIndicator {
+ // keep in sync with CheckDelegate.qml (shared CheckIndicator.qml was removed for performance reasons)
+ indicator: Rectangle {
+ implicitWidth: 28
+ implicitHeight: 28
+
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
- control: control
+
+ color: control.down ? control.palette.light : control.palette.base
+ border.width: control.visualFocus ? 2 : 1
+ border.color: control.visualFocus ? control.palette.highlight : control.palette.mid
+
+ ColorImage {
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ defaultColor: "#353637"
+ color: control.palette.text
+ source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png"
+ visible: control.checkState === Qt.Checked
+ }
+
+ Rectangle {
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ width: 16
+ height: 3
+ color: control.palette.text
+ visible: control.checkState === Qt.PartiallyChecked
+ }
}
- contentItem: Text {
+ contentItem: CheckLabel {
leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
text: control.text
font: control.font
- color: control.down ? Default.textDarkColor : Default.textColor
- elide: Text.ElideRight
- verticalAlignment: Text.AlignVCenter
- opacity: enabled ? 1 : 0.3
+ color: control.palette.windowText
}
}