From 5388260020d8d60401499ccba3a7a35f06898daf Mon Sep 17 00:00:00 2001 From: quadbyte Date: Wed, 6 Aug 2025 20:11:33 -0400 Subject: [PATCH] Settings: some more refinments --- Widgets/SettingsWindow/Tabs/Display.qml | 2 +- Widgets/SettingsWindow/Tabs/Network.qml | 72 ++++++++++++++--------- Widgets/SettingsWindow/Tabs/Wallpaper.qml | 11 +--- 3 files changed, 48 insertions(+), 37 deletions(-) diff --git a/Widgets/SettingsWindow/Tabs/Display.qml b/Widgets/SettingsWindow/Tabs/Display.qml index 85353a8..8ed677c 100644 --- a/Widgets/SettingsWindow/Tabs/Display.qml +++ b/Widgets/SettingsWindow/Tabs/Display.qml @@ -32,7 +32,7 @@ ColumnLayout { ColumnLayout { - spacing: 4 + spacing: 12 Layout.fillWidth: true Text { diff --git a/Widgets/SettingsWindow/Tabs/Network.qml b/Widgets/SettingsWindow/Tabs/Network.qml index 4a2f2c4..13ee16a 100644 --- a/Widgets/SettingsWindow/Tabs/Network.qml +++ b/Widgets/SettingsWindow/Tabs/Network.qml @@ -3,19 +3,17 @@ import QtQuick.Controls import QtQuick.Layouts import Quickshell import Quickshell.Bluetooth -import qs.Settings import qs.Components +import qs.Settings ColumnLayout { id: root + spacing: 24 - Component.onCompleted: { - - Quickshell.execDetached(["nmcli", "-t", "-f", "WIFI", "radio"]) + Quickshell.execDetached(["nmcli", "-t", "-f", "WIFI", "radio"]); } - ColumnLayout { spacing: 16 Layout.fillWidth: true @@ -53,20 +51,24 @@ ColumnLayout { wrapMode: Text.WordWrap Layout.fillWidth: true } + } Rectangle { id: wifiSwitch + + property bool checked: Settings.settings.wifiEnabled + width: 52 height: 32 radius: 16 - property bool checked: Settings.settings.wifiEnabled color: checked ? Theme.accentPrimary : Theme.surfaceVariant border.color: checked ? Theme.accentPrimary : Theme.outline border.width: 2 Rectangle { id: wifiThumb + width: 28 height: 28 radius: 14 @@ -81,30 +83,36 @@ ColumnLayout { duration: 200 easing.type: Easing.OutCubic } + } + } MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: { - Settings.settings.wifiEnabled = !Settings.settings.wifiEnabled - Quickshell.execDetached(["nmcli", "radio", "wifi", Settings.settings.wifiEnabled ? "on" : "off"]) + Settings.settings.wifiEnabled = !Settings.settings.wifiEnabled; + Quickshell.execDetached(["nmcli", "radio", "wifi", Settings.settings.wifiEnabled ? "on" : "off"]); } } + } + } + } + } - Rectangle { - Layout.fillWidth: true - Layout.topMargin: 26 - Layout.bottomMargin: 18 - height: 1 - color: Theme.outline - opacity: 0.3 - } + Rectangle { + Layout.fillWidth: true + Layout.topMargin: 26 + Layout.bottomMargin: 0 + height: 1 + color: Theme.outline + opacity: 0.3 + } ColumnLayout { spacing: 16 @@ -143,20 +151,24 @@ ColumnLayout { wrapMode: Text.WordWrap Layout.fillWidth: true } + } Rectangle { id: bluetoothSwitch + + property bool checked: Settings.settings.bluetoothEnabled + width: 52 height: 32 radius: 16 - property bool checked: Settings.settings.bluetoothEnabled color: checked ? Theme.accentPrimary : Theme.surfaceVariant border.color: checked ? Theme.accentPrimary : Theme.outline border.width: 2 Rectangle { id: bluetoothThumb + width: 28 height: 28 radius: 14 @@ -171,7 +183,9 @@ ColumnLayout { duration: 200 easing.type: Easing.OutCubic } + } + } MouseArea { @@ -179,22 +193,26 @@ ColumnLayout { cursorShape: Qt.PointingHandCursor onClicked: { if (Bluetooth.defaultAdapter) { - Settings.settings.bluetoothEnabled = !Settings.settings.bluetoothEnabled - Bluetooth.defaultAdapter.enabled = Settings.settings.bluetoothEnabled - if (Bluetooth.defaultAdapter.enabled) { - Bluetooth.defaultAdapter.discovering = true - } + Settings.settings.bluetoothEnabled = !Settings.settings.bluetoothEnabled; + Bluetooth.defaultAdapter.enabled = Settings.settings.bluetoothEnabled; + if (Bluetooth.defaultAdapter.enabled) + Bluetooth.defaultAdapter.discovering = true; + } } } - } - } - } - } + } + + } + + } + + } Item { Layout.fillWidth: true Layout.fillHeight: true } -} \ No newline at end of file + +} diff --git a/Widgets/SettingsWindow/Tabs/Wallpaper.qml b/Widgets/SettingsWindow/Tabs/Wallpaper.qml index 58b5571..e2fe2c7 100644 --- a/Widgets/SettingsWindow/Tabs/Wallpaper.qml +++ b/Widgets/SettingsWindow/Tabs/Wallpaper.qml @@ -37,7 +37,7 @@ ColumnLayout { Layout.fillWidth: true Text { - text: "Wallpaper" + text: "Wallpaper Settings" font.pixelSize: 18 font.bold: true color: Theme.textPrimary @@ -48,14 +48,7 @@ ColumnLayout { ColumnLayout { spacing: 8 Layout.fillWidth: true - Layout.topMargin: 16 - - Text { - text: "Wallpaper Settings" - font.pixelSize: 13 - font.bold: true - color: Theme.textPrimary - } + Layout.topMargin: 8 // Wallpaper Folder ColumnLayout {