87 lines
2.8 KiB
Plaintext
87 lines
2.8 KiB
Plaintext
(defwidget big-media [ album-background ?player-info ]
|
|
(box :class "big-media ${ album-background == true ? 'album-bg' : '' }"
|
|
:style { album-background == true ? "background-image: image(url('${json_media.artUrl}'))" : "" }
|
|
:visible { json_media.title != "null" && json_media.artist != "null" ? true : false }
|
|
:space-evenly false
|
|
:orientation "vertical"
|
|
|
|
(box :orientation "horizontal"
|
|
:space-evenly false
|
|
:class "media"
|
|
|
|
(box :class "album-image"
|
|
:width 98
|
|
:height 87
|
|
:style "background-image: image(url('${json_media.artUrl}'));"
|
|
:valign "center")
|
|
|
|
(box :orientation "vertical"
|
|
:space-evenly false
|
|
:class "right"
|
|
:hexpand true
|
|
|
|
(box :class "media-info"
|
|
:space-evenly false
|
|
:halign "fill"
|
|
:orientation "vertical"
|
|
|
|
(label :class "title"
|
|
:text "${json_media.title}"
|
|
:xalign 0
|
|
:wrap false
|
|
:hexpand true
|
|
:show-truncated true)
|
|
(label :class "artist"
|
|
:text "${json_media.artist}"
|
|
:xalign 0
|
|
:wrap false
|
|
:hexpand true
|
|
:show-truncated true)
|
|
)
|
|
|
|
(box :class "controls"
|
|
:orientation "horizontal"
|
|
:space-evenly false
|
|
:halign "start"
|
|
|
|
(box :class "button-row"
|
|
:orientation "horizontal"
|
|
:space-evenly false
|
|
:halign "start"
|
|
:visible { json_media.url != "null" ? true : false }
|
|
|
|
(button :class "url"
|
|
:onclick "wl-copy '${json_media.url}'"
|
|
:style "padding-right: 13px;"
|
|
:tooltip "Copy link to Clipboard"
|
|
"")
|
|
)
|
|
|
|
(box :class "button-row"
|
|
:orientation "horizontal"
|
|
:space-evenly false
|
|
:halign "start"
|
|
|
|
(button :class "shuffle"
|
|
:onclick "playerctl --player=${json_media.player} shuffle Toggle"
|
|
:tooltip "Toggle shuffle"
|
|
"")
|
|
(button :class "previous"
|
|
:onclick "playerctl --player=${json_media.player} previous"
|
|
:tooltip "Previous"
|
|
"")
|
|
(button :class "play-pause"
|
|
:onclick "playerctl --player=${json_media.player} play-pause"
|
|
:tooltip { json_media.status == "playing" ? "Pause" : "Play" }
|
|
{ json_media.status == "playing" ? "" : "" })
|
|
(button :class "next"
|
|
:onclick "playerctl --player=${json_media.player} next"
|
|
:tooltip "Next"
|
|
"")
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|