mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 02:30:52 +00:00
29 lines
580 B
QML
29 lines
580 B
QML
import QtQuick 2.0
|
|
import QtQuick.Controls 2.2
|
|
|
|
MenuItem {
|
|
// Ensure focus can't be given to an invisible item
|
|
enabled: visible
|
|
height: visible ? implicitHeight : 0
|
|
focusPolicy: visible ? Qt.TabFocus : Qt.NoFocus
|
|
|
|
onTriggered: {
|
|
// We must close the context menu first or
|
|
// it can steal focus from any dialogs that
|
|
// onTriggered may spawn.
|
|
menu.close()
|
|
}
|
|
|
|
Keys.onReturnPressed: {
|
|
triggered()
|
|
}
|
|
|
|
Keys.onEnterPressed: {
|
|
triggered()
|
|
}
|
|
|
|
Keys.onEscapePressed: {
|
|
menu.close()
|
|
}
|
|
}
|