Add WallpaperSelector, add some scrolling in SettingsWindow
This commit is contained in:
parent
eff47f504f
commit
8155ef20eb
14 changed files with 1451 additions and 674 deletions
|
|
@ -1,64 +1,80 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Bluetooth
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
Item {
|
||||
property real scaling: 1
|
||||
readonly property string tabIcon: "wifi"
|
||||
readonly property string tabLabel: "Network"
|
||||
readonly property int tabIndex: 4
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: Style.marginMedium * scaling
|
||||
spacing: 0
|
||||
|
||||
NText {
|
||||
text: "Wi‑Fi"
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Colors.accentSecondary
|
||||
}
|
||||
ScrollView {
|
||||
id: scrollView
|
||||
|
||||
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"])
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
padding: 16
|
||||
rightPadding: 12
|
||||
clip: true
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||
|
||||
ColumnLayout {
|
||||
width: scrollView.availableWidth
|
||||
spacing: 0
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 0
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
ColumnLayout {
|
||||
spacing: 4
|
||||
Layout.fillWidth: true
|
||||
|
||||
NText {
|
||||
text: "Bluetooth"
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Colors.accentSecondary
|
||||
}
|
||||
NText {
|
||||
text: "Network Settings"
|
||||
font.pointSize: 18
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Colors.textPrimary
|
||||
Layout.bottomMargin: 8
|
||||
}
|
||||
|
||||
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
|
||||
// Network interfaces section
|
||||
ColumnLayout {
|
||||
spacing: 8
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 8
|
||||
|
||||
NText {
|
||||
text: "Network Interfaces"
|
||||
font.pointSize: 13
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Colors.textPrimary
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: "WiFi Enabled"
|
||||
description: "Enable WiFi connectivity"
|
||||
value: Settings.data.network.wifiEnabled
|
||||
onToggled: function (newValue) {
|
||||
Settings.data.network.wifiEnabled = newValue
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: "Bluetooth Enabled"
|
||||
description: "Enable Bluetooth connectivity"
|
||||
value: Settings.data.network.bluetoothEnabled
|
||||
onToggled: function (newValue) {
|
||||
Settings.data.network.bluetoothEnabled = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue