From 19d5358b97158ef72c6b7e9f797bb1219967d2ad Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 13 Dec 2020 12:50:56 -0600 Subject: [PATCH] Add a PC menu header to show the current PC status --- app/gui/NavigableMenu.qml | 9 ++++++++- app/gui/PcView.qml | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/gui/NavigableMenu.qml b/app/gui/NavigableMenu.qml index 301437de..72ba3ef0 100644 --- a/app/gui/NavigableMenu.qml +++ b/app/gui/NavigableMenu.qml @@ -3,6 +3,13 @@ import QtQuick.Controls 2.2 Menu { onOpened: { - itemAt(0).forceActiveFocus(Qt.TabFocusReason) + // Give focus to the first visible and enabled menu item + for (var i = 0; i < count; i++) { + var item = itemAt(i) + if (item.visible && item.enabled) { + item.forceActiveFocus(Qt.TabFocusReason) + break + } + } } } diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index b80b0259..35062d7c 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -162,6 +162,11 @@ CenteredGridView { NavigableMenu { id: pcContextMenu + MenuItem { + text: qsTr("PC Status: %1").arg(model.online ? qsTr("Online") : qsTr("Offline")) + font.bold: true + enabled: false + } NavigableMenuItem { parentMenu: pcContextMenu text: qsTr("View All Apps")