mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 10:40:59 +00:00
33 lines
727 B
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()
|
|
}
|
|
}
|