Add basic settings, gotta fix layout
This commit is contained in:
parent
152272c51a
commit
8cb519e5f4
9 changed files with 537 additions and 71 deletions
|
|
@ -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: "Wi‑Fi"; font.weight: Style.fontWeightBold; color: Colors.accentSecondary }
|
||||
|
||||
NToggle {
|
||||
label: "Enable Wi‑Fi"
|
||||
description: "Turn Wi‑Fi 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 }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue