moment/src/gui/Base/HTileDelegate.qml

35 lines
853 B
QML
Raw Normal View History

import QtQuick 2.12
import QtQuick.Layouts 1.12
HTile {
id: tile
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
}
signal activated()
property HListView view: ListView.view
property bool shouldBeCurrent: false
readonly property QtObject delegateModel: model
readonly property alias setCurrentTimer: setCurrentTimer
Timer {
id: setCurrentTimer
interval: 100
repeat: true
running: true
// Component.onCompleted won't work for this
onTriggered: if (shouldBeCurrent) view.currentIndex = model.index
}
}