mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 07:22:50 -05:00
qmlfmt with 4 space
This commit is contained in:
@@ -9,48 +9,49 @@ import Quickshell.Services.Mpris
|
||||
import Quickshell.Widgets
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
id: root
|
||||
|
||||
readonly property list<MprisPlayer> availablePlayers: Mpris.players.values
|
||||
readonly property list<MprisPlayer> availablePlayers: Mpris.players.values
|
||||
|
||||
property MprisPlayer activePlayer: availablePlayers.find(p => p.isPlaying)
|
||||
?? availablePlayers.find(
|
||||
p => p.canControl && p.canPlay) ?? null
|
||||
property MprisPlayer activePlayer: availablePlayers.find(p => p.isPlaying)
|
||||
?? availablePlayers.find(
|
||||
p => p.canControl
|
||||
&& p.canPlay) ?? null
|
||||
|
||||
IpcHandler {
|
||||
target: "mpris"
|
||||
IpcHandler {
|
||||
target: "mpris"
|
||||
|
||||
function list(): string {
|
||||
return root.availablePlayers.map(p => p.identity).join("")
|
||||
function list(): string {
|
||||
return root.availablePlayers.map(p => p.identity).join("")
|
||||
}
|
||||
|
||||
function play(): void {
|
||||
if (root.activePlayer?.canPlay)
|
||||
root.activePlayer.play()
|
||||
}
|
||||
|
||||
function pause(): void {
|
||||
if (root.activePlayer?.canPause)
|
||||
root.activePlayer.pause()
|
||||
}
|
||||
|
||||
function playPause(): void {
|
||||
if (root.activePlayer?.canTogglePlaying)
|
||||
root.activePlayer.togglePlaying()
|
||||
}
|
||||
|
||||
function previous(): void {
|
||||
if (root.activePlayer?.canGoPrevious)
|
||||
root.activePlayer.previous()
|
||||
}
|
||||
|
||||
function next(): void {
|
||||
if (root.activePlayer?.canGoNext)
|
||||
root.activePlayer.next()
|
||||
}
|
||||
|
||||
function stop(): void {
|
||||
root.activePlayer?.stop()
|
||||
}
|
||||
}
|
||||
|
||||
function play(): void {
|
||||
if (root.activePlayer?.canPlay)
|
||||
root.activePlayer.play()
|
||||
}
|
||||
|
||||
function pause(): void {
|
||||
if (root.activePlayer?.canPause)
|
||||
root.activePlayer.pause()
|
||||
}
|
||||
|
||||
function playPause(): void {
|
||||
if (root.activePlayer?.canTogglePlaying)
|
||||
root.activePlayer.togglePlaying()
|
||||
}
|
||||
|
||||
function previous(): void {
|
||||
if (root.activePlayer?.canGoPrevious)
|
||||
root.activePlayer.previous()
|
||||
}
|
||||
|
||||
function next(): void {
|
||||
if (root.activePlayer?.canGoNext)
|
||||
root.activePlayer.next()
|
||||
}
|
||||
|
||||
function stop(): void {
|
||||
root.activePlayer?.stop()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user