2019-08-21 04:39:07 -04:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
|
2019-09-14 16:05:57 -04:00
|
|
|
HTile {
|
2019-08-21 04:39:07 -04:00
|
|
|
id: tile
|
2019-09-14 16:05:57 -04:00
|
|
|
onActivated: view.currentIndex = model.index
|
2019-09-14 18:52:43 -04:00
|
|
|
onLeftClicked: {
|
2019-09-14 17:39:17 -04:00
|
|
|
view.highlightRangeMode = ListView.NoHighlightRange
|
|
|
|
view.highlightMoveDuration = 0
|
|
|
|
activated()
|
|
|
|
view.highlightRangeMode = ListView.ApplyRange
|
|
|
|
view.highlightMoveDuration = theme.animationDuration
|
|
|
|
}
|
2019-09-14 16:05:57 -04:00
|
|
|
|
2019-08-21 04:39:07 -04:00
|
|
|
|
|
|
|
signal activated()
|
|
|
|
|
2019-08-21 06:02:00 -04:00
|
|
|
property HListView view: ListView.view
|
|
|
|
property bool shouldBeCurrent: false
|
2019-08-21 04:39:07 -04:00
|
|
|
|
2019-09-14 16:05:57 -04:00
|
|
|
readonly property QtObject delegateModel: model
|
2019-08-21 04:39:07 -04:00
|
|
|
|
2019-08-23 10:53:54 -04:00
|
|
|
readonly property alias setCurrentTimer: setCurrentTimer
|
2019-08-21 04:39:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
Timer {
|
2019-08-23 10:53:54 -04:00
|
|
|
id: setCurrentTimer
|
2019-08-21 04:39:07 -04:00
|
|
|
interval: 100
|
|
|
|
repeat: true
|
2019-08-23 10:53:54 -04:00
|
|
|
running: true
|
2019-08-21 04:39:07 -04:00
|
|
|
// Component.onCompleted won't work for this
|
2019-08-21 06:02:00 -04:00
|
|
|
onTriggered: if (shouldBeCurrent) view.currentIndex = model.index
|
2019-08-21 04:39:07 -04:00
|
|
|
}
|
|
|
|
}
|