f8632e40e7
Add a native Qt "Bigscreen" shell: CMakeLists, C++ entry (main.cpp, InputRouter), QML module (Theme, ShellWindow, views and components) and a Bigscreen/.gitignore; update top-level .gitignore and README with Qt build/run instructions. Remove the legacy Tauri/web prototype files (package.json, package-lock.json, src-tauri and many web assets) as part of the migration to the Qt/CMake-based shell.
93 lines
2.5 KiB
QML
93 lines
2.5 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Nebula.Bigscreen
|
|
|
|
Rectangle {
|
|
id: root
|
|
|
|
property int focusIndex: 0
|
|
readonly property var actions: [
|
|
{ label: "Sleep", meta: "Suspend system" },
|
|
{ label: "Restart", meta: "Reboot NebulaOS" },
|
|
{ label: "Shut down", meta: "Power off" },
|
|
{ label: "Log out", meta: "Return to login" },
|
|
{ label: "Desktop Mode", meta: "Switch session" },
|
|
{ label: "Close", meta: "Back to Home" }
|
|
]
|
|
|
|
signal dismissed()
|
|
signal actionChosen(string actionId)
|
|
|
|
anchors.fill: parent
|
|
color: "#CC050A17"
|
|
|
|
Keys.onPressed: function(event) { event.accepted = true }
|
|
|
|
ColumnLayout {
|
|
anchors.centerIn: parent
|
|
width: Math.min(parent.width - 80, 520)
|
|
spacing: 12
|
|
|
|
Text {
|
|
text: "Power"
|
|
font: Theme.brandFont
|
|
color: Theme.textPrimary
|
|
Layout.alignment: Qt.AlignHCenter
|
|
}
|
|
|
|
Repeater {
|
|
model: root.actions
|
|
|
|
Rectangle {
|
|
Layout.fillWidth: true
|
|
height: 56
|
|
radius: 10
|
|
color: index === root.focusIndex ? "#22304A66" : Theme.backgroundPanel
|
|
border.color: index === root.focusIndex ? Theme.accentCyan : Theme.accentLine
|
|
border.width: index === root.focusIndex ? 2 : 1
|
|
|
|
RowLayout {
|
|
anchors.fill: parent
|
|
anchors.margins: 16
|
|
|
|
Text {
|
|
text: modelData.label
|
|
font: Theme.titleFont
|
|
color: Theme.textPrimary
|
|
}
|
|
|
|
Item { Layout.fillWidth: true }
|
|
|
|
Text {
|
|
text: modelData.meta
|
|
font: Theme.metaFont
|
|
color: Theme.textMuted
|
|
}
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
onClicked: {
|
|
root.focusIndex = index
|
|
root.activateFocused()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function moveFocus(delta) {
|
|
focusIndex = Math.max(0, Math.min(actions.length - 1, focusIndex + delta))
|
|
}
|
|
|
|
function activateFocused() {
|
|
const labels = ["sleep", "restart", "shutdown", "logout", "desktop", "close"]
|
|
const id = labels[focusIndex]
|
|
if (id === "close") {
|
|
dismissed()
|
|
} else {
|
|
actionChosen(id)
|
|
}
|
|
}
|
|
}
|