aboutsummaryrefslogtreecommitdiffstats
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/Drawer.qml1
-rw-r--r--desktop/Module.qml3
-rw-r--r--desktop/README.md5
-rw-r--r--desktop/modules/bluetooth/BluetoothModule.qml3
-rw-r--r--desktop/modules/bluetooth/BluetoothTile.qml3
-rw-r--r--desktop/modules/network/NetworkModule.qml13
-rw-r--r--desktop/modules/network/NetworkPage.qml4
7 files changed, 24 insertions, 8 deletions
diff --git a/desktop/Drawer.qml b/desktop/Drawer.qml
index f3b8e6d..aea6855 100644
--- a/desktop/Drawer.qml
+++ b/desktop/Drawer.qml
@@ -152,6 +152,7 @@ Scope {
width: (grid.width - 2 * grid.spacing) / 3
icon: modelData.icon
label: modelData.label
+ active: modelData.active
content: modelData.tileContent
onClicked: root.activate(modelData)
}
diff --git a/desktop/Module.qml b/desktop/Module.qml
index eabe434..7c13b9b 100644
--- a/desktop/Module.qml
+++ b/desktop/Module.qml
@@ -35,6 +35,9 @@ QtObject {
// module implements its own lifetime. Pages are lazily loaded either way.
property bool alwaysActive: false
+ // Whether the tile should render in its active accent. Default false.
+ property bool active: false
+
// Rendered inside the tile, below the icon: a short state line. Null for
// a tile that says nothing beyond its label.
property Component tileContent: null
diff --git a/desktop/README.md b/desktop/README.md
index c5cddfa..f440512 100644
--- a/desktop/README.md
+++ b/desktop/README.md
@@ -137,8 +137,9 @@ the vm page the same way, with `ipc call drawer open vm`. The full list of
edits to the live Hyprland and waybar configuration is Task 10 of the plan in
`docs/superpowers/plans/2026-09-14-desktop-shell.md`.
-The drawer is the only place network and Bluetooth are managed, so waybar's
-own network and Bluetooth indicators were removed in the same change.
+The drawer is the only place network and Bluetooth are managed. The drawer
+replaces waybar's own network and Bluetooth indicators; removing them is a
+live-configuration change outside this repo.
## Theme
diff --git a/desktop/modules/bluetooth/BluetoothModule.qml b/desktop/modules/bluetooth/BluetoothModule.qml
index 80f80b9..4fd600f 100644
--- a/desktop/modules/bluetooth/BluetoothModule.qml
+++ b/desktop/modules/bluetooth/BluetoothModule.qml
@@ -36,6 +36,9 @@ Module {
// Null for the first ~2s, then filled. Safe navigation everywhere.
icon: mod.adapter && mod.adapter.enabled ? "\uf293" : "\uf05e"
+ // Active while anything is connected.
+ active: mod.anyConnected
+
function notify(title, body) {
notifyProc.command = ["notify-send", "--app-name=bluetooth",
"--urgency=critical", "--icon=error", title, body];
diff --git a/desktop/modules/bluetooth/BluetoothTile.qml b/desktop/modules/bluetooth/BluetoothTile.qml
index 1489f16..226e1da 100644
--- a/desktop/modules/bluetooth/BluetoothTile.qml
+++ b/desktop/modules/bluetooth/BluetoothTile.qml
@@ -21,6 +21,7 @@ Text {
color: bt.anyConnected ? Theme.text : Theme.subtext
text: !bt.adapter || !bt.adapter.enabled ? "Off"
: bt.connectedDevices.length === 0 ? "No devices"
- : bt.connectedDevices.length === 1 ? bt.connectedDevices[0].name
+ : bt.connectedDevices.length === 1
+ ? (bt.connectedDevices[0].name || bt.connectedDevices[0].deviceName || bt.connectedDevices[0].address)
: bt.connectedDevices.length + " connected"
}
diff --git a/desktop/modules/network/NetworkModule.qml b/desktop/modules/network/NetworkModule.qml
index d14853f..6ff98b5 100644
--- a/desktop/modules/network/NetworkModule.qml
+++ b/desktop/modules/network/NetworkModule.qml
@@ -60,6 +60,9 @@ Module {
// drawer reads this property like any other.
icon: mod.wiredUp ? "\uf796" : (mod.wifiUp ? "\uf1eb" : "\uf05e")
+ // Active while any link is up.
+ active: mod.wiredUp || mod.wifiUp
+
// The network a connect is pending on, so connectionFailed can be caught.
property var pendingNetwork: null
property string error: ""
@@ -76,8 +79,8 @@ Module {
net.connectWithPsk(psk);
}
- function disconnectNetwork(net) { if (net) net.disconnect(); }
- function forget(net) { if (net) net.forget(); }
+ function disconnectNetwork(net) { mod.error = ""; if (net) net.disconnect(); }
+ function forget(net) { mod.error = ""; if (net) net.forget(); }
// A failure after the drawer closed would otherwise go unseen, so it also
// raises a notification. Same cached-Process shape as VmModule.
@@ -93,10 +96,14 @@ Module {
property Connections conn: Connections {
target: mod.pendingNetwork
function onConnectionFailed(reason) {
- mod.error = "Connection failed: " + reason;
+ mod.error = "Could not connect to " + (mod.pendingNetwork?.name ?? "network");
mod.notify("Network", mod.error);
mod.pendingNetwork = null;
}
+ function onConnectedChanged() {
+ if (mod.pendingNetwork && mod.pendingNetwork.connected)
+ mod.pendingNetwork = null;
+ }
}
tileContent: Component { NetworkTile { net: mod } }
diff --git a/desktop/modules/network/NetworkPage.qml b/desktop/modules/network/NetworkPage.qml
index 3a6362a..0951231 100644
--- a/desktop/modules/network/NetworkPage.qml
+++ b/desktop/modules/network/NetworkPage.qml
@@ -66,7 +66,7 @@ Column {
}
}
- Rectangle { width: page.width; height: 1; color: Qt.alpha(Theme.text, 0.12) }
+ Rectangle { width: page.width; height: 1; visible: page.net.wiredDevices.length > 0; color: Qt.alpha(Theme.text, 0.12) }
// --- Wifi ---
@@ -106,7 +106,7 @@ Column {
Button {
text: page.net.wifiDevice && page.net.wifiDevice.scannerEnabled ? "Scanning…" : "Scan"
- onClicked: if (page.net.wifiDevice) page.net.wifiDevice.scannerEnabled = true
+ onClicked: if (page.net.wifiDevice) page.net.wifiDevice.scannerEnabled = !page.net.wifiDevice.scannerEnabled
}
}