|
|
|
@ -23,31 +23,31 @@ Rectangle {
@@ -23,31 +23,31 @@ Rectangle {
|
|
|
|
|
|
|
|
|
|
property alias model: checkListRepeater.model |
|
|
|
|
|
|
|
|
|
property bool _passed: false |
|
|
|
|
property bool _passed: false |
|
|
|
|
|
|
|
|
|
// We delay the updates when a group passes so the user can see all items green for a moment prior to hiding |
|
|
|
|
Timer { |
|
|
|
|
id: delayedGroupPassed |
|
|
|
|
interval: 750 |
|
|
|
|
|
|
|
|
|
property int index |
|
|
|
|
|
|
|
|
|
onTriggered: { |
|
|
|
|
function _handleGroupPassedChanged(index, passed) { |
|
|
|
|
if (passed) { |
|
|
|
|
// Collapse current group |
|
|
|
|
var group = checkListRepeater.itemAt(index) |
|
|
|
|
group._checked = false |
|
|
|
|
// Expand next group |
|
|
|
|
if (index + 1 < checkListRepeater.count) { |
|
|
|
|
group = checkListRepeater.itemAt(index + 1) |
|
|
|
|
group.enabled = true |
|
|
|
|
group._checked = true |
|
|
|
|
} |
|
|
|
|
for (var i=0; i<checkListRepeater.count; i++) { |
|
|
|
|
if (!checkListRepeater.itemAt(i).passed) { |
|
|
|
|
_passed = false |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
_passed = true |
|
|
|
|
} |
|
|
|
|
_passed = passed |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// We delay the updates when a group passes so the user can see all items green for a moment prior to hiding |
|
|
|
|
Timer { |
|
|
|
|
id: delayedGroupPassed |
|
|
|
|
interval: 750 |
|
|
|
|
|
|
|
|
|
property int index |
|
|
|
|
|
|
|
|
|
onTriggered: _handleGroupPassedChanged(index, true /* passed */) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Column { |
|
|
|
@ -59,9 +59,13 @@ Rectangle {
@@ -59,9 +59,13 @@ Rectangle {
|
|
|
|
|
anchors.topMargin: 0.6*ScreenTools.defaultFontPixelWidth |
|
|
|
|
anchors.leftMargin: 1.5*ScreenTools.defaultFontPixelWidth |
|
|
|
|
|
|
|
|
|
function groupPassedChanged(index) { |
|
|
|
|
delayedGroupPassed.index = index |
|
|
|
|
delayedGroupPassed.restart() |
|
|
|
|
function groupPassedChanged(index, passed) { |
|
|
|
|
if (passed) { |
|
|
|
|
delayedGroupPassed.index = index |
|
|
|
|
delayedGroupPassed.restart() |
|
|
|
|
} else { |
|
|
|
|
_handleGroupPassedChanged(index, passed) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Header/title of checklist |
|
|
|
|