Add basic settings, gotta fix layout

This commit is contained in:
Ly-sec 2025-08-12 00:45:53 +02:00
parent 152272c51a
commit 8cb519e5f4
9 changed files with 537 additions and 71 deletions

View file

@ -1,5 +1,7 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Bluetooth
import qs.Services
import qs.Widgets
@ -13,17 +15,35 @@ Item {
ColumnLayout {
anchors.fill: parent
spacing: Style.marginMedium * scaling
NText {
text: "Network"
font.weight: Style.fontWeightBold
color: Colors.accentSecondary
NText { text: "WiFi"; font.weight: Style.fontWeightBold; color: Colors.accentSecondary }
NToggle {
label: "Enable WiFi"
description: "Turn WiFi radio on or off"
value: Settings.data.network.wifiEnabled
onToggled: function (newValue) {
Settings.data.network.wifiEnabled = newValue
Quickshell.execDetached(["nmcli", "radio", "wifi", newValue ? "on" : "off"]) }
}
NText {
text: "Coming soon"
color: Colors.textSecondary
}
Item {
Layout.fillHeight: true
NDivider { Layout.fillWidth: true }
NText { text: "Bluetooth"; font.weight: Style.fontWeightBold; color: Colors.accentSecondary }
NToggle {
label: "Enable Bluetooth"
description: "Turn Bluetooth radio on or off"
value: Settings.data.network.bluetoothEnabled
onToggled: function (newValue) {
Settings.data.network.bluetoothEnabled = newValue
if (Bluetooth.defaultAdapter) {
Bluetooth.defaultAdapter.enabled = newValue
if (Bluetooth.defaultAdapter.enabled) Bluetooth.defaultAdapter.discovering = true
}
}
}
Item { Layout.fillHeight: true }
}
}