From 93769a1161e41137fae01da4a6c81893ad129d8d Mon Sep 17 00:00:00 2001 From: Jin Liu Date: Sat, 3 Feb 2024 13:21:52 +0800 Subject: [PATCH] applet: hide tray icon when device is paired but not connected In this state, the user can do nothing in the applet. Hiding it to unclutter the systray overflow. --- plasmoid/package/contents/ui/main.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index ad6df3278..dd705d7c1 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -21,6 +21,10 @@ PlasmoidItem || plasmoid.location == PlasmaCore.Types.BottomEdge || plasmoid.location == PlasmaCore.Types.LeftEdge) + DevicesModel { + id: allDevicesModel + } + DevicesModel { id: connectDeviceModel displayFilter: DevicesModel.Paired | DevicesModel.Reachable @@ -44,7 +48,7 @@ PlasmoidItem Binding { target: plasmoid property: "status" - value: (connectDeviceModel.count > 0) ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.PassiveStatus + value: (connectDeviceModel.count > 0) ? PlasmaCore.Types.ActiveStatus : ((allDevicesModel.count === 0) ? PlasmaCore.Types.PassiveStatus : PlasmaCore.Types.HiddenStatus) } fullRepresentation: FullRepresentation {