diff --git a/config/eww/windows/sidebar.scss b/config/eww/windows/sidebar.scss index 0ae0b98..4f941f4 100644 --- a/config/eww/windows/sidebar.scss +++ b/config/eww/windows/sidebar.scss @@ -234,6 +234,21 @@ window .sidebar { } } + .media-info-text { + margin: 0 40px; + } + + .circular-symbol-with-text { + &.media-title { + margin-top: dpi(27px); + margin-bottom: dpi(17px); + } + + &.media-artist { + margin-bottom: dpi(20px); + } + } + .visualizer { min-height: dpi(66px); .invisible-slider { @@ -556,17 +571,6 @@ window .sidebar { } -.circular-symbol-with-text { - &.media-title { - margin-top: dpi(27px); - margin-bottom: dpi(17px); - } - - &.media-artist { - margin-bottom: dpi(20px); - } -} - .weather { margin-bottom: dpi(30px); } diff --git a/config/eww/windows/sidebar.yuck b/config/eww/windows/sidebar.yuck index 8de3c12..897c6d9 100644 --- a/config/eww/windows/sidebar.yuck +++ b/config/eww/windows/sidebar.yuck @@ -269,20 +269,28 @@ )) ) - ; Artist and title (truncated so that the eww window does not grow) - ; Character limit should be adjusted according to font family, font size, - ; and desired max length of the eww window - (circular-symbol-with-text - :extra-class "media-title" - :symbol "" - :text-left "${strlength(media-json.title) > 35 ? "${substring(media-json.title, 0, 32)}..." : media-json.title}" - :text-right "") - - (circular-symbol-with-text - :extra-class "media-artist" - :symbol "" - :text-left "${strlength(media-json.artist) > 35 ? "${substring(media-json.artist, 0, 32)}..." : media-json.artist}" - :text-right "") + ; Artist and title inside scroll containers to prevent the sidebar + ; from growing when the text is too long + (box :class "media-info-text" + :orientation "vertical" + :space-evenly false + (scroll + :hscroll true + :vscroll false + (circular-symbol-with-text + :extra-class "media-title" + :symbol "" + :text-left "${media-json.title}" + :text-right "")) + (scroll + :hscroll true + :vscroll false + (circular-symbol-with-text + :extra-class "media-artist" + :symbol "" + :text-left "${media-json.artist}" + :text-right "")) + ) (media-progress-visualizer)