diff --git a/app/gui/AppView.qml b/app/gui/AppView.qml index 88df59ad..5e42718a 100644 --- a/app/gui/AppView.qml +++ b/app/gui/AppView.qml @@ -31,6 +31,11 @@ GridView { stackView.pop() } + Component.onCompleted: { + // Don't show any highlighted item until interacting with them + currentIndex = -1 + } + onVisibleChanged: { if (visible) { appModel.computerLost.connect(computerLost) @@ -51,7 +56,7 @@ GridView { delegate: NavigableItemDelegate { width: 200; height: 335; - grid: pcGrid + grid: appGrid Image { id: appIcon @@ -129,7 +134,7 @@ GridView { } height: visible ? implicitHeight : 0 } - MenuItem { + NavigableMenuItem { text: "Quit Game" onTriggered: { quitAppDialog.appName = appModel.getRunningAppName() diff --git a/app/gui/NavigableItemDelegate.qml b/app/gui/NavigableItemDelegate.qml index ca79f0b0..f0f37c53 100644 --- a/app/gui/NavigableItemDelegate.qml +++ b/app/gui/NavigableItemDelegate.qml @@ -4,6 +4,8 @@ import QtQuick.Controls 2.2 ItemDelegate { property GridView grid + highlighted: grid.activeFocus && grid.currentItem === this + Keys.onLeftPressed: { grid.moveCurrentIndexLeft() } @@ -13,11 +15,9 @@ ItemDelegate { Keys.onDownPressed: { grid.moveCurrentIndexDown() } - Keys.onUpPressed: { grid.moveCurrentIndexUp() } - Keys.onReturnPressed: { clicked() } diff --git a/app/gui/NavigableMenuItem.qml b/app/gui/NavigableMenuItem.qml new file mode 100644 index 00000000..5e2cadd5 --- /dev/null +++ b/app/gui/NavigableMenuItem.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.2 + +MenuItem { + Keys.onReturnPressed: { + triggered() + } +} diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index 57b7856c..e26ea563 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -45,6 +45,9 @@ GridView { else if (!prefs.hasAnyHardwareAcceleration()) { noHwDecoderDialog.open() } + + // Don't show any highlighted item until interacting with them + currentIndex = -1 } function pairingComplete(error) @@ -131,13 +134,13 @@ GridView { Menu { id: pcContextMenu - MenuItem { + NavigableMenuItem { text: "Wake PC" onTriggered: computerModel.wakeComputer(index) visible: !model.addPc && !model.online && model.wakeable height: visible ? implicitHeight : 0 } - MenuItem { + NavigableMenuItem { text: "Delete PC" onTriggered: { deletePcDialog.pcIndex = index diff --git a/app/gui/main.qml b/app/gui/main.qml index 86ab1d66..f8f3ffd7 100644 --- a/app/gui/main.qml +++ b/app/gui/main.qml @@ -26,7 +26,7 @@ ApplicationWindow { focus: true onCurrentItemChanged: { - // Ensure focus travels to the next view + // Ensure focus travels to the next view when going back if (currentItem) { currentItem.forceActiveFocus() } @@ -37,6 +37,12 @@ ApplicationWindow { stackView.pop() } } + + Keys.onBackPressed: { + if (depth > 1) { + stackView.pop() + } + } } onVisibilityChanged: { diff --git a/app/qml.qrc b/app/qml.qrc index 051bbe19..65731193 100644 --- a/app/qml.qrc +++ b/app/qml.qrc @@ -9,5 +9,6 @@ gui/QuitSegue.qml gui/NavigableToolButton.qml gui/NavigableItemDelegate.qml + gui/NavigableMenuItem.qml