Hide the plasmoid when no device is connected
Reviewed by albertvaka@gmail.com
This commit is contained in:
parent
2a235f6496
commit
0029c62a2d
1 changed files with 12 additions and 0 deletions
|
@ -50,6 +50,15 @@ Item {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
function showPlasmoidBeShown()
|
||||||
|
{
|
||||||
|
if (devicesView.count > 0) {
|
||||||
|
plasmoid.status = ActiveStatus;
|
||||||
|
} else {
|
||||||
|
plasmoid.status = PassiveStatus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PlasmaExtras.ScrollArea {
|
PlasmaExtras.ScrollArea {
|
||||||
id: dialogItem
|
id: dialogItem
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -58,9 +67,12 @@ Item {
|
||||||
id: devicesView
|
id: devicesView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
model: KdeConnect.DevicesModel {
|
model: KdeConnect.DevicesModel {
|
||||||
|
id: connectDeviceModel
|
||||||
displayFilter: 0x11
|
displayFilter: 0x11
|
||||||
}
|
}
|
||||||
delegate: DeviceDelegate { }
|
delegate: DeviceDelegate { }
|
||||||
|
onCountChanged: showPlasmoidBeShown()
|
||||||
|
Component.onCompleted: showPlasmoidBeShown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue