summaryrefslogtreecommitdiff
path: root/modules/controlcenter/bluetooth/BtPane.qml
diff options
context:
space:
mode:
authorATMDA <atdma2600@gmail.com>2025-11-19 19:25:26 -0500
committerATMDA <atdma2600@gmail.com>2025-11-19 19:25:26 -0500
commit2d26626643e447b5c9f6f78619e8472bc35ea599 (patch)
treecfc4e9fa366705a77d18698c060990e281bf49c5 /modules/controlcenter/bluetooth/BtPane.qml
parentrefactor: NetworkConnection util created, migrated all functions (diff)
downloadcaelestia-shell-2d26626643e447b5c9f6f78619e8472bc35ea599.tar.gz
caelestia-shell-2d26626643e447b5c9f6f78619e8472bc35ea599.tar.bz2
caelestia-shell-2d26626643e447b5c9f6f78619e8472bc35ea599.zip
refactor: SplitPaneWithDetails integrated
Diffstat (limited to 'modules/controlcenter/bluetooth/BtPane.qml')
-rw-r--r--modules/controlcenter/bluetooth/BtPane.qml84
1 files changed, 14 insertions, 70 deletions
diff --git a/modules/controlcenter/bluetooth/BtPane.qml b/modules/controlcenter/bluetooth/BtPane.qml
index c20f14b..3cd6ef9 100644
--- a/modules/controlcenter/bluetooth/BtPane.qml
+++ b/modules/controlcenter/bluetooth/BtPane.qml
@@ -2,87 +2,39 @@ pragma ComponentBehavior: Bound
import ".."
import "../components"
+import qs.components
import qs.components.controls
-import qs.components.effects
import qs.components.containers
import qs.config
import Quickshell.Widgets
import Quickshell.Bluetooth
import QtQuick
-import QtQuick.Layouts
-Item {
+SplitPaneWithDetails {
id: root
required property Session session
anchors.fill: parent
- SplitPaneLayout {
- anchors.fill: parent
+ activeItem: session.bt.active
+ paneIdGenerator: function(item) {
+ return item ? (item.address || "") : "";
+ }
- leftContent: Component {
- DeviceList {
- anchors.fill: parent
- session: root.session
- }
+ leftContent: Component {
+ DeviceList {
+ session: root.session
}
+ }
- rightContent: Component {
- Item {
- id: rightBtPane
-
- property BluetoothDevice pane: root.session.bt.active
- property string paneId: pane ? (pane.address || "") : ""
- property Component targetComponent: settings
- property Component nextComponent: settings
-
- function getComponentForPane() {
- return pane ? details : settings;
- }
-
- Component.onCompleted: {
- targetComponent = getComponentForPane();
- nextComponent = targetComponent;
- }
-
- Loader {
- id: rightLoader
-
- anchors.fill: parent
-
- asynchronous: true
- sourceComponent: rightBtPane.targetComponent
- }
-
- Behavior on paneId {
- PaneTransition {
- target: rightLoader
- propertyActions: [
- PropertyAction {
- target: rightBtPane
- property: "targetComponent"
- value: rightBtPane.nextComponent
- }
- ]
- }
- }
-
- Connections {
- target: root.session.bt
- function onActiveChanged() {
- rightBtPane.pane = root.session.bt.active;
- rightBtPane.nextComponent = rightBtPane.getComponentForPane();
- rightBtPane.paneId = pane ? (pane.address || "") : "";
- }
- }
- }
+ rightDetailsComponent: Component {
+ Details {
+ session: root.session
}
}
- Component {
- id: settings
-
+ rightSettingsComponent: Component {
StyledFlickable {
id: settingsFlickable
flickableDirection: Flickable.VerticalFlick
@@ -102,12 +54,4 @@ Item {
}
}
}
-
- Component {
- id: details
-
- Details {
- session: root.session
- }
- }
}