From 02910957f17aa4d86134e037ba4586b9975d5921 Mon Sep 17 00:00:00 2001 From: Damocles Date: Sat, 25 Apr 2026 22:52:28 +0200 Subject: [PATCH] move network/bluetooth refresh + active tracking into applets, fix dock parent.expanded --- shell/applets/BluetoothApplet.qml | 3 +++ shell/applets/NetworkApplet.qml | 3 +++ shell/dock/AppletDock.qml | 4 +++- shell/dock/DockCard.qml | 3 ++- shell/modules/BluetoothModule.qml | 3 --- shell/modules/NetworkModule.qml | 3 --- test/qmllint-baseline.txt | 1 - 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/shell/applets/BluetoothApplet.qml b/shell/applets/BluetoothApplet.qml index 89ff63b..bc6c4cc 100644 --- a/shell/applets/BluetoothApplet.qml +++ b/shell/applets/BluetoothApplet.qml @@ -5,6 +5,9 @@ Column { id: root required property color accentColor + property bool active: true + onActiveChanged: if (active) + S.BluetoothService.refresh() Repeater { model: S.BluetoothService.devices diff --git a/shell/applets/NetworkApplet.qml b/shell/applets/NetworkApplet.qml index 2344e7d..749d950 100644 --- a/shell/applets/NetworkApplet.qml +++ b/shell/applets/NetworkApplet.qml @@ -5,6 +5,9 @@ Column { id: root required property color accentColor + property bool active: true + onActiveChanged: if (active) + S.NetworkService.refresh() Repeater { model: S.NetworkService.networks diff --git a/shell/dock/AppletDock.qml b/shell/dock/AppletDock.qml index d1a788a..c38bbbb 100644 --- a/shell/dock/AppletDock.qml +++ b/shell/dock/AppletDock.qml @@ -251,7 +251,7 @@ PanelWindow { devices: S.SystemStats.tempDevices accentColor: root._accent deviceFilter: S.Modules.temperature.device || "" - active: parent.parent.expanded + active: parent.expanded } } @@ -296,6 +296,7 @@ PanelWindow { C.NetworkApplet { width: parent.width accentColor: root._accent + active: parent.expanded } } @@ -310,6 +311,7 @@ PanelWindow { C.BluetoothApplet { width: parent.width accentColor: root._accent + active: parent.expanded } } diff --git a/shell/dock/DockCard.qml b/shell/dock/DockCard.qml index 5a496b9..d946cd1 100644 --- a/shell/dock/DockCard.qml +++ b/shell/dock/DockCard.qml @@ -89,9 +89,10 @@ Rectangle { } } - // Content area + // Content area - expanded propagated so children can bind `active: parent.expanded` Column { id: _contentColumn + property bool expanded: root.expanded anchors.top: _header.bottom anchors.topMargin: 4 width: parent.width diff --git a/shell/modules/BluetoothModule.qml b/shell/modules/BluetoothModule.qml index 347a614..5d0ea98 100644 --- a/shell/modules/BluetoothModule.qml +++ b/shell/modules/BluetoothModule.qml @@ -54,9 +54,6 @@ M.BarModule { } } - on_ShowPanelChanged: if (_showPanel) - S.BluetoothService.refresh() - Connections { target: S.BluetoothService function onDevicesChanged() { diff --git a/shell/modules/NetworkModule.qml b/shell/modules/NetworkModule.qml index b434888..2aa9dac 100644 --- a/shell/modules/NetworkModule.qml +++ b/shell/modules/NetworkModule.qml @@ -56,9 +56,6 @@ M.BarModule { readonly property string state: S.NetworkService.state - on_ShowPanelChanged: if (_showPanel) - S.NetworkService.refresh() - Connections { target: S.NetworkService function onNetworksChanged() { diff --git a/test/qmllint-baseline.txt b/test/qmllint-baseline.txt index 83b42c3..708aa1d 100644 --- a/test/qmllint-baseline.txt +++ b/test/qmllint-baseline.txt @@ -18,7 +18,6 @@ shell/applets/PowerApplet.qml: Unqualified access [unqualified] shell/applets/TemperatureApplet.qml: Unqualified access [unqualified] shell/applets/VolumeApplet.qml: Unqualified access [unqualified] shell/dock/AppletDock.qml: Could not find property "top". [missing-property] -shell/dock/AppletDock.qml: Member "expanded" not found on type "QQuickItem" [missing-property] shell/dock/AppletDock.qml: Type margins is used but it is not resolved [unresolved-type] shell/dock/AppletDock.qml: Type PanelWindow is not creatable. [uncreatable-type] shell/dock/AppletDock.qml: unknown grouped property scope margins. [unqualified]