import QtQuick import QtQuick.Controls import Nebula.Bigscreen ApplicationWindow { id: window width: 1280 height: 720 visible: true title: "Nebula Bigscreen" color: Theme.backgroundDeep property string currentView: "home" property bool powerOverlayVisible: false property string signedInUser: "Player" NebulaBackground { anchors.fill: parent } Column { anchors.fill: parent spacing: 0 TopBar { id: topBar width: parent.width userName: window.signedInUser accentFocus: contentLoader.item && contentLoader.item.accentFocus !== undefined ? contentLoader.item.accentFocus() : 0 } Loader { id: contentLoader width: parent.width height: parent.height - topBar.height sourceComponent: viewComponentFor(window.currentView) } } Connections { target: contentLoader.item ignoreUnknownSignals: true function onNavigate(route) { window.onChildNavigate(route) } function onGoBack() { window.onChildGoBack() } } PowerOverlay { id: powerOverlay visible: window.powerOverlayVisible z: 10 onDismissed: window.powerOverlayVisible = false onActionChosen: function(actionId) { console.log("Power action:", actionId) window.powerOverlayVisible = false } } Connections { target: InputRouter function onActionTriggered(action) { if (window.powerOverlayVisible) { window.handlePowerInput(action) return } if (action === 7) { window.powerOverlayVisible = true return } if (contentLoader.item && contentLoader.item.handleInput) { contentLoader.item.handleInput(action) } } } Component { id: homeComponent HomeView {} } Component { id: libraryComponent LibraryView {} } Component { id: settingsComponent SettingsView {} } function viewComponentFor(viewId) { switch (viewId) { case "library": return libraryComponent case "settings": return settingsComponent default: return homeComponent } } function onChildNavigate(route) { if (route === "power") { window.powerOverlayVisible = true return } window.currentView = route } function onChildGoBack() { window.currentView = "home" } function handlePowerInput(action) { switch (action) { case 1: powerOverlay.moveFocus(-1) break case 2: powerOverlay.moveFocus(1) break case 5: powerOverlay.activateFocused() break case 6: window.powerOverlayVisible = false break default: break } } }