diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-20 10:57:47 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-20 10:57:47 +0200 |
commit | 2ca1d1fb9390d8b8f7395f6f4c69d53988d9a4a9 (patch) | |
tree | f733058acc1650829df01fe8bfa1d1a677470cdf | |
parent | 8a5d409456fa2505c0d78509e3ef5a2a5b517ec3 (diff) | |
download | kube-2ca1d1fb9390d8b8f7395f6f4c69d53988d9a4a9.tar.gz kube-2ca1d1fb9390d8b8f7395f6f4c69d53988d9a4a9.zip |
Toggle checkbox with return.
toggle() doesn't reliably work for some reason,
so we use the checked state instead.
-rw-r--r-- | framework/qml/CheckBox.qml | 4 | ||||
-rw-r--r-- | views/calendar/qml/View.qml | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/framework/qml/CheckBox.qml b/framework/qml/CheckBox.qml index ce4df209..e0655887 100644 --- a/framework/qml/CheckBox.qml +++ b/framework/qml/CheckBox.qml | |||
@@ -26,7 +26,9 @@ T.CheckBox { | |||
26 | implicitWidth: indicator.width | 26 | implicitWidth: indicator.width |
27 | implicitHeight: indicator.width | 27 | implicitHeight: indicator.width |
28 | 28 | ||
29 | Keys.onReturnPressed: root.toggle() | 29 | Keys.onReturnPressed: { |
30 | root.checked = !root.checked | ||
31 | } | ||
30 | 32 | ||
31 | indicator: Rectangle { | 33 | indicator: Rectangle { |
32 | width: Kube.Units.gridUnit | 34 | width: Kube.Units.gridUnit |
diff --git a/views/calendar/qml/View.qml b/views/calendar/qml/View.qml index fe88b084..065faecb 100644 --- a/views/calendar/qml/View.qml +++ b/views/calendar/qml/View.qml | |||
@@ -17,7 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | import QtQuick 2.9 | 19 | import QtQuick 2.9 |
20 | import QtQuick.Controls 2.1 | 20 | import QtQuick.Controls 2 |
21 | import QtQuick.Layouts 1.2 | 21 | import QtQuick.Layouts 1.2 |
22 | 22 | ||
23 | import org.kube.framework 1.0 as Kube | 23 | import org.kube.framework 1.0 as Kube |
@@ -156,7 +156,9 @@ RowLayout { | |||
156 | id: checkBox | 156 | id: checkBox |
157 | opacity: 0.9 | 157 | opacity: 0.9 |
158 | checked: !model.checked | 158 | checked: !model.checked |
159 | onToggled: model.checked = !checked | 159 | onCheckedChanged: { |
160 | model.checked = !checked | ||
161 | } | ||
160 | 162 | ||
161 | indicator: Rectangle { | 163 | indicator: Rectangle { |
162 | width: Kube.Units.gridUnit | 164 | width: Kube.Units.gridUnit |