Skip to content

Commit

Permalink
Merge pull request #75 from ccatterina/fix-widget-visibility
Browse files Browse the repository at this point in the history
fix: widget visibile when there is no active player
  • Loading branch information
ccatterina committed Mar 17, 2024
2 parents da3d1c0 + ceb1a7d commit d641352
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ import org.kde.plasma.private.mpris as Mpris

PlasmoidItem {
id: widget
Plasmoid.status: player.ready ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.HiddenStatus

Plasmoid.status: PlasmaCore.Types.HiddenStatus

Player {
id: player
sourceName: plasmoid.configuration.sources[plasmoid.configuration.sourceIndex]
onReadyChanged: {
Plasmoid.status = player.ready ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.HiddenStatus
console.debug(`Player ready changed: ${player.ready} -> plasmoid status changed: ${Plasmoid.status}`)
}
}

compactRepresentation: Item {
Expand Down Expand Up @@ -235,4 +240,4 @@ PlasmoidItem {

}
}
}
}

0 comments on commit d641352

Please sign in to comment.