diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-14 13:48:04 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-14 13:48:04 +0200 |
| commit | e1a1e4953d90d2c92ae9d6a6fece0fb333639fe7 (patch) | |
| tree | 613b8d4d8c77919cde1895877ba1b6b5a46fdb30 /desktop/modules/network/NetworkPage.qml | |
| parent | 168809afa62ba7c167ec96e4a6453bd3705965ea (diff) | |
| download | quickshell-e1a1e4953d90d2c92ae9d6a6fece0fb333639fe7.tar.gz quickshell-e1a1e4953d90d2c92ae9d6a6fece0fb333639fe7.zip | |
feat(desktop): network wifi page
Radio switch, scan, and a list ordered connected, known, strongest. A
secured unknown network reveals an inline password field rather than
opening a popup, since a QtQuick.Controls popup is a separate window that
positions badly on this layer surface, the same reason the sound page
expands in place.
Connection failures come through the Network.connectionFailed signal and
show inline; the same failure also notifies, for the case where the
drawer has closed by the time it lands.
Diffstat (limited to 'desktop/modules/network/NetworkPage.qml')
| -rw-r--r-- | desktop/modules/network/NetworkPage.qml | 68 |
1 files changed, 67 insertions, 1 deletions
diff --git a/desktop/modules/network/NetworkPage.qml b/desktop/modules/network/NetworkPage.qml index 0c79ef6..3a6362a 100644 --- a/desktop/modules/network/NetworkPage.qml +++ b/desktop/modules/network/NetworkPage.qml @@ -11,9 +11,9 @@ import Quickshell.Networking import QtQuick +import QtQuick.Controls import "../.." -// The wired half. Sibling of NetworkPage's wifi half, added in Task 2. Column { id: page @@ -29,6 +29,8 @@ Column { : "disconnected"; } + // --- Wired --- + Text { visible: page.net.wiredDevices.length > 0 text: "Wired" @@ -63,4 +65,68 @@ Column { } } } + + Rectangle { width: page.width; height: 1; color: Qt.alpha(Theme.text, 0.12) } + + // --- Wifi --- + + Item { + width: page.width + implicitHeight: Math.max(wifiLabel.implicitHeight, wifiSwitch.implicitHeight) + + Text { + id: wifiLabel + anchors.verticalCenter: parent.verticalCenter + text: "Wi-Fi" + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 1; bold: true } + color: Theme.text + } + + Switch { + id: wifiSwitch + anchors { right: parent.right; verticalCenter: parent.verticalCenter } + enabled: Networking.wifiHardwareEnabled + checked: page.net.wifiOn + onToggled: Networking.wifiEnabled = checked + } + } + + Text { + width: page.width + visible: !page.net.wifiOn + text: "Wi-Fi off" + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2 } + color: Theme.subtext + } + + Row { + width: page.width + visible: page.net.wifiOn + spacing: 8 + + Button { + text: page.net.wifiDevice && page.net.wifiDevice.scannerEnabled ? "Scanning…" : "Scan" + onClicked: if (page.net.wifiDevice) page.net.wifiDevice.scannerEnabled = true + } + } + + Repeater { + model: page.net.wifiOn ? page.net.wifiNetworksSorted : [] + + NetworkRow { + required property var modelData + net: page.net + entry: modelData + width: page.width + } + } + + Text { + width: page.width + visible: page.net.error !== "" + wrapMode: Text.Wrap + text: page.net.error + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 3 } + color: Theme.red + } } |
