eww: refactor and improved experience with media widgets

This commit is contained in:
retrozinndev
2024-12-21 13:17:51 -03:00
parent 5bc04e4dff
commit 9b8f81417f
9 changed files with 39 additions and 30 deletions
-86
View File
@@ -1,86 +0,0 @@
(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"
"󰒭")
)
)
)
)
)
)
+2 -2
View File
@@ -45,8 +45,8 @@
(label :class "summary"
:text "${summary}"
:xalign 0
:show-truncated true
:halign "start")
:halign "start"
:show-truncated true)
(label :class "body"
:markup "${body}"