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