Files
moonlight-qt/app/gui/NavigableItemDelegate.qml

33 lines
727 B
QML

import QtQuick 2.0
import QtQuick.Controls 2.2
ItemDelegate {
property GridView grid
highlighted: grid.activeFocus && grid.currentItem === this
Keys.onLeftPressed: {
grid.moveCurrentIndexLeft()
}
Keys.onRightPressed: {
grid.moveCurrentIndexRight()
}
Keys.onDownPressed: {
grid.moveCurrentIndexDown()
}
Keys.onUpPressed: {
grid.moveCurrentIndexUp()
// If we've reached the top of the grid, move focus to the toolbar
if (grid.currentItem === this) {
nextItemInFocusChain(false).forceActiveFocus(Qt.TabFocus)
}
}
Keys.onReturnPressed: {
clicked()
}
Keys.onEnterPressed: {
clicked()
}
}