Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions components/AppLauncher.qml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,22 @@ Rectangle {
type: "action",
badge: "[DESKTOP]",
badgeColor: Theme.accent,
title: "Control Center / Settings",
desc: "Open display, audio, network, and theme settings",
title: "Control Center",
desc: "Quick volume, media, brightness, Wi-Fi, and Bluetooth controls",
icon: "preferences-system",
keywords: "settings control center config preferences options display audio network",
keywords: "control center volume audio bluetooth wifi brightness media",
action: function() { Ui.closeAll(); Ui.toggleSettings(); }
},
{
type: "action",
badge: "[SYSTEM]",
badgeColor: Theme.accent,
title: "HacknetOS Settings",
desc: "Open full system, theme, desktop, input, and keybind settings",
icon: "preferences-system",
keywords: "settings preferences theme keybinds display network keyboard mouse timezone",
action: function() { Ui.closeAll(); Quickshell.execDetached(["hacknet-settings"]); }
},
{
type: "action",
badge: "[DESKTOP]",
Expand Down
239 changes: 58 additions & 181 deletions components/SettingsPanel.qml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import QtQuick
import Quickshell
import "../singletons"

// Settings / control center, styled like a Hacknet window: grey caption strip,
// flat buttons, no rounded panels or coloured gradients.
// Sections appear dynamically based on available hardware/commands.
// Control Center: quick hardware & media controls only.
// Full OS, desktop, theme, and keybind settings live in hacknet-settings.
Rectangle {
id: root
implicitWidth: 520
implicitHeight: 640
implicitHeight: 560

color: "#0b0d13"
border.width: 1
Expand All @@ -29,8 +29,6 @@ Rectangle {
color: Theme.borderDim
}

// Scrollable content: the control center holds more sections than fit on
// small outputs, so nothing is ever cut off.
Flickable {
id: flick
anchors { left: parent.left; right: parent.right; top: parent.top; topMargin: 30
Expand Down Expand Up @@ -80,49 +78,9 @@ Rectangle {
anchors { left: parent.left; right: parent.right; leftMargin: 18; rightMargin: 18 }
spacing: 14

// -------------------------------------------------------- THEME
// -------------------------------------------------------- VOLUME
Text {
text: "THEME"
color: "#9aa0ab"
font.family: Theme.mono
font.pixelSize: Theme.monoPx
font.letterSpacing: 1
}

Flow {
width: parent.width
spacing: 8
Repeater {
model: [
{ id: "blue", name: "BLUE" },
{ id: "ente", name: "ENTE" },
{ id: "hellhound", name: "HELLHOUND" },
{ id: "naix", name: "NAIX" },
{ id: "hacknet", name: "HACKNET" }
]
delegate: LauncherButton {
label: modelData.name
active: Theme.themeId === modelData.id
onTriggered: Daemon.setTheme(modelData.id)
}
}
}

// Admin-configurable default theme from /etc/hacknetos/theme.cfg
Text {
width: parent.width
text: "config: " + (Daemon.themeCfg || "blue")
color: Theme.dim
font.family: Theme.mono
font.pixelSize: Math.max(7, Theme.monoPx - 3)
visible: Daemon.themeCfg !== ""
}

Rectangle { width: parent.width; height: 1; color: Theme.borderDim }

// ------------------------------------------------------ DISPLAY
Text {
text: "DISPLAY"
text: "VOLUME"
color: "#9aa0ab"
font.family: Theme.mono
font.pixelSize: Theme.monoPx
Expand All @@ -131,76 +89,36 @@ Rectangle {

HacknetSlider {
width: parent.width
visible: Daemon.hasBrightness
label: "BRIGHTNESS"
value: Daemon.currentBrightness
onValueChangedByUser: (val) => Daemon.setBrightness(val)
label: "OUTPUT VOLUME"
value: Math.min(1.0, Daemon.currentVolume)
displayValue: Daemon.isMuted ? "MUTED" : Math.round(Daemon.currentVolume * 100) + "%"
onValueChangedByUser: (val) => Daemon.setVolume(val)
}

Flow {
width: parent.width
spacing: 8

LauncherButton {
label: "RAM GUTTER: " + (Daemon.gutterHidden ? "OFF" : "ON")
active: !Daemon.gutterHidden
onTriggered: Daemon.run("hacknetctl", ["toggle-gutter"])
}

LauncherButton {
label: "CONSOLE: " + (Daemon.terminalBottomOnly
? "BOTTOM RIGHT" : "FULL COLUMN")
active: !Daemon.terminalBottomOnly
onTriggered: Daemon.toggleTerminalBottomOnly()
}

LauncherButton {
label: "FULLSCREEN"
visible: Daemon.stageWindows.length > 0
onTriggered: {
const w = Daemon.stageWindows.find(x => x.active)
|| Daemon.stageWindows[0];
if (w) Daemon.setFullscreen(String(w.id), true);
}
}

LauncherButton {
label: "LEAVE FULLSCREEN"
visible: Daemon.fullscreenActive
onTriggered: {
if (Daemon.fullscreenWindow)
Daemon.setFullscreen(Daemon.fullscreenWindow, false);
}
}
LauncherButton {
label: Daemon.isMuted ? "UNMUTE" : "MUTE"
active: Daemon.isMuted
onTriggered: Daemon.toggleMute()
}

Rectangle { width: parent.width; height: 1; color: Theme.borderDim }

// -------------------------------------------------------- AUDIO
// ------------------------------------------------ MEDIA CONTROLS
Text {
text: "AUDIO"
text: "MEDIA CONTROLS"
color: "#9aa0ab"
font.family: Theme.mono
font.pixelSize: Theme.monoPx
font.letterSpacing: 1
}

HacknetSlider {
width: parent.width
label: "VOLUME"
value: Math.min(1.0, Daemon.currentVolume)
displayValue: Daemon.isMuted ? "MUTED" : Math.round(Daemon.currentVolume * 100) + "%"
onValueChangedByUser: (val) => Daemon.setVolume(val)
}

Flow {
width: parent.width
spacing: 8

LauncherButton {
label: Daemon.isMuted ? "UNMUTE" : "MUTE"
active: Daemon.isMuted
onTriggered: Daemon.toggleMute()
label: "PREV"
onTriggered: Daemon.run("hacknetctl", ["media", "prev"])
}

LauncherButton {
Expand All @@ -209,8 +127,8 @@ Rectangle {
}

LauncherButton {
label: "PREV"
onTriggered: Daemon.run("hacknetctl", ["media", "prev"])
label: "STOP"
onTriggered: Daemon.run("hacknetctl", ["media", "stop"])
}

LauncherButton {
Expand All @@ -219,50 +137,44 @@ Rectangle {
}
}

Rectangle { width: parent.width; height: 1; color: Theme.borderDim }
// -------------------------------------------- DISPLAY BRIGHTNESS
Rectangle {
width: parent.width; height: 1; color: Theme.borderDim
visible: Daemon.hasBrightness
}

// ------------------------------------------------ NOTIFICATIONS
Text {
text: "NOTIFICATIONS"
text: "DISPLAY BRIGHTNESS"
color: "#9aa0ab"
font.family: Theme.mono
font.pixelSize: Theme.monoPx
font.letterSpacing: 1
visible: Daemon.hasBrightness
}

Flow {
HacknetSlider {
width: parent.width
spacing: 8

LauncherButton {
label: "DO NOT DISTURB: " + (Daemon.dnd ? "ON" : "OFF")
active: Daemon.dnd
onTriggered: Daemon.setDnd(!Daemon.dnd)
}

LauncherButton {
label: "CLEAR HISTORY"
onTriggered: Notifs.clear()
}
visible: Daemon.hasBrightness
label: "BRIGHTNESS"
value: Daemon.currentBrightness
onValueChangedByUser: (val) => Daemon.setBrightness(val)
}

// ------------------------------------------------- WIFI SETTINGS
Rectangle {
width: parent.width; height: 1; color: Theme.borderDim
visible: Daemon.hasWifi || Daemon.hasBluetooth
visible: Daemon.hasWifi
}

// ------------------------------------------------------ NETWORK
// Only shown when the hardware exists.
Text {
text: "NETWORK"
text: "WIFI SETTINGS"
color: "#9aa0ab"
font.family: Theme.mono
font.pixelSize: Theme.monoPx
font.letterSpacing: 1
visible: Daemon.hasWifi || Daemon.hasBluetooth
visible: Daemon.hasWifi
}

// Wi-Fi Section
Column {
id: wifiSection
width: parent.width
Expand Down Expand Up @@ -418,7 +330,21 @@ Rectangle {
}
}

// Bluetooth Section
// -------------------------------------------- BLUETOOTH SETTINGS
Rectangle {
width: parent.width; height: 1; color: Theme.borderDim
visible: Daemon.hasBluetooth
}

Text {
text: "BLUETOOTH SETTINGS"
color: "#9aa0ab"
font.family: Theme.mono
font.pixelSize: Theme.monoPx
font.letterSpacing: 1
visible: Daemon.hasBluetooth
}

Column {
width: parent.width
spacing: 8
Expand Down Expand Up @@ -496,71 +422,22 @@ Rectangle {

Rectangle { width: parent.width; height: 1; color: Theme.borderDim }

// ----------------------------------------------------- DESKTOPS
Text {
text: "DESKTOPS"
color: "#9aa0ab"
font.family: Theme.mono
font.pixelSize: Theme.monoPx
font.letterSpacing: 1
}

Row {
spacing: 8

LauncherButton {
label: "+ NEW DESKTOP"
onTriggered: Daemon.addDesktop()
label: "OPEN SETTINGS"
onTriggered: {
Ui.closeAll();
Quickshell.execDetached(["hacknet-settings"]);
}
}

LauncherButton {
label: "- REMOVE"
visible: Daemon.desktopCount > 1
onTriggered: Daemon.removeDesktop(Daemon.currentDesktop)
}
}

Flow {
width: parent.width
spacing: 8

Repeater {
model: Daemon.desktopCount
delegate: LauncherButton {
label: "D" + (index + 1)
active: Daemon.currentDesktop === (index + 1)
onTriggered: Daemon.switchDesktop(index + 1)
}
label: "CLOSE"
onTriggered: Ui.closeAll()
}
}

Rectangle { width: parent.width; height: 1; color: Theme.borderDim }

// ------------------------------------------------------- SYSTEM
Text {
text: "SYSTEM"
color: "#9aa0ab"
font.family: Theme.mono
font.pixelSize: Theme.monoPx
font.letterSpacing: 1
}

Text {
width: parent.width
text: "host " + Daemon.hostname + " addr " + Daemon.homeAddress
+ "\nuser " + Daemon.username + " kernel " + Daemon.version
color: Theme.dim
font.family: Theme.mono
font.pixelSize: Math.max(9, Theme.monoPx - 1)
lineHeight: 1.3
}

Item { width: 1; height: 6 }

LauncherButton {
label: "CLOSE"
onTriggered: Ui.closeAll()
}
}
}
}
Loading
Loading