Merge pull request #1824 from turannul/pr/bluetooth-refactor-pt2

bluetooth refactor pt2
This commit is contained in:
Lemmy
2026-02-13 22:44:26 -05:00
committed by GitHub
7 changed files with 61 additions and 48 deletions
+49 -42
View File
@@ -377,53 +377,14 @@
"subTab": 1,
"subTabLabel": "common.templates"
},
{
"labelKey": "common.bluetooth",
"descriptionKey": null,
"widget": "NLabel",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": null
},
{
"labelKey": "panels.connections.hide-unnamed-devices-label",
"descriptionKey": "panels.connections.hide-unnamed-devices-description",
"widget": "NToggle",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": null
},
{
"labelKey": "panels.connections.disable-discoverability-label",
"descriptionKey": "panels.connections.disable-discoverability-description",
"widget": "NToggle",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": null
},
{
"labelKey": "panels.connections.bluetooth-rssi-polling-label",
"descriptionKey": "panels.connections.bluetooth-rssi-polling-description",
"widget": "NToggle",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": null
},
{
"labelKey": "panels.connections.bluetooth-rssi-polling-interval-label",
"descriptionKey": "panels.connections.bluetooth-rssi-polling-interval-description",
"widget": "NSpinBox",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": null
},
{
"labelKey": "toast.airplane-mode.title",
"descriptionKey": null,
"widget": "NLabel",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": null
"subTab": 0,
"subTabLabel": "common.wifi"
},
{
"labelKey": "common.wifi",
@@ -431,7 +392,53 @@
"widget": "NLabel",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": null
"subTab": 0,
"subTabLabel": "common.wifi"
},
{
"labelKey": "common.bluetooth",
"descriptionKey": null,
"widget": "NLabel",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": 1,
"subTabLabel": "common.bluetooth"
},
{
"labelKey": "panels.connections.hide-unnamed-devices-label",
"descriptionKey": "panels.connections.hide-unnamed-devices-description",
"widget": "NToggle",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": 1,
"subTabLabel": "common.bluetooth"
},
{
"labelKey": "panels.connections.disable-discoverability-label",
"descriptionKey": "panels.connections.disable-discoverability-description",
"widget": "NToggle",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": 1,
"subTabLabel": "common.bluetooth"
},
{
"labelKey": "panels.connections.bluetooth-rssi-polling-label",
"descriptionKey": "panels.connections.bluetooth-rssi-polling-description",
"widget": "NToggle",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": 1,
"subTabLabel": "common.bluetooth"
},
{
"labelKey": "panels.connections.bluetooth-rssi-polling-interval-label",
"descriptionKey": "panels.connections.bluetooth-rssi-polling-interval-description",
"widget": "NSpinBox",
"tab": 15,
"tabLabel": "panels.connections.title",
"subTab": 1,
"subTabLabel": "common.bluetooth"
},
{
"labelKey": "common.position",
+1 -1
View File
@@ -175,7 +175,7 @@ SmartPanel {
icon: "settings"
Layout.alignment: Qt.AlignHCenter
onClicked: {
SettingsPanel.openToTab(SettingsPanel.Tab.Bluetooth);
SettingsPanelService.openToTab(SettingsPanel.Tab.Connections, 1, screen);
root.close();
}
}
@@ -9,6 +9,7 @@ import qs.Modules.Panels.Settings.Tabs.About
import qs.Modules.Panels.Settings.Tabs.Audio
import qs.Modules.Panels.Settings.Tabs.Bar
import qs.Modules.Panels.Settings.Tabs.ColorScheme
import qs.Modules.Panels.Settings.Tabs.Connections
import qs.Modules.Panels.Settings.Tabs.ControlCenter
import qs.Modules.Panels.Settings.Tabs.Display
import qs.Modules.Panels.Settings.Tabs.Dock
@@ -20,8 +20,8 @@ Item {
// Configuration for shared use (e.g. by BluetoothPanel)
property bool showOnlyLists: false
property bool isScanningActive: BluetoothService.scanningActive
property bool isDiscoverable: BluetoothService.discoverable
readonly property bool isScanningActive: BluetoothService.scanningActive
readonly property bool isDiscoverable: BluetoothService.discoverable
// Device lists with local filtering logic
readonly property var connectedDevices: {
@@ -145,6 +145,7 @@ Item {
visible: !btprefs.showOnlyLists
Layout.fillWidth: true
Layout.preferredHeight: masterControlCol.implicitHeight
border.color: "transparent"
ColumnLayout {
id: masterControlCol
@@ -206,6 +207,7 @@ Item {
visible: btprefs.connectedDevices.length > 0 && BluetoothService.enabled
Layout.fillWidth: true
Layout.preferredHeight: connectedDevicesCol.implicitHeight + Style.marginXL
border.color: showOnlyLists ? Style.boxBorderColor : "transparent"
ColumnLayout {
id: connectedDevicesCol
@@ -238,6 +240,7 @@ Item {
visible: btprefs.pairedDevices.length > 0 && BluetoothService.enabled
Layout.fillWidth: true
Layout.preferredHeight: pairedDevicesCol.implicitHeight + Style.marginXL
border.color: showOnlyLists ? Style.boxBorderColor : "transparent"
ColumnLayout {
id: pairedDevicesCol
@@ -270,6 +273,7 @@ Item {
visible: !btprefs.showOnlyLists && btprefs.unnamedAvailableDevices.length > 0 && BluetoothService.enabled
Layout.fillWidth: true
Layout.preferredHeight: availableDevicesCol.implicitHeight + Style.marginXL
border.color: "transparent"
ColumnLayout {
id: availableDevicesCol
@@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import qs.Commons
import qs.Modules.Panels.Settings.Tabs.Connections
import qs.Services.Networking
import qs.Widgets
@@ -38,8 +37,8 @@ ColumnLayout {
NTabView {
id: tabView
Layout.fillHeight: true
currentIndex: subTabBar.currentIndex
WifiSubTab {}
BluetoothSubTab {}
}
@@ -29,6 +29,7 @@ Item {
NBox {
Layout.fillWidth: true
Layout.preferredHeight: masterControlColAirplane.implicitHeight
border.color: "transparent"
ColumnLayout {
id: masterControlColAirplane
@@ -66,6 +67,7 @@ Item {
NBox {
Layout.fillWidth: true
Layout.preferredHeight: masterControlCol.implicitHeight
border.color: "transparent"
ColumnLayout {
id: masterControlCol
+1 -1
View File
@@ -75,7 +75,7 @@ Singleton {
"hooks": SettingsPanel.Tab.Hooks,
"launcher": SettingsPanel.Tab.Launcher,
"location": SettingsPanel.Tab.Location,
"network": SettingsPanel.Tab.Network,
"connections": SettingsPanel.Tab.Connections,
"notifications": SettingsPanel.Tab.Notifications,
"plugins": SettingsPanel.Tab.Plugins,
"sessionmenu": SettingsPanel.Tab.SessionMenu,