bar: fix being too tall when vertical

This commit is contained in:
2 * r + 2 * t 2025-02-19 14:34:41 +11:00
parent 58d26dcf60
commit 7bf8cd4cf0
2 changed files with 2 additions and 2 deletions

View file

@ -151,7 +151,7 @@ const MediaPlaying = () => {
angle={config.vertical ? 270 : 0}
setup={self =>
players.hookLastPlayer(self, ["notify::title", "notify::artist"], () => {
self.label = ellipsize(getLabel("No media")); // TODO: scroll text
self.label = ellipsize(getLabel("No media"), config.vertical ? 30 : 40); // TODO: scroll text
})
}
/>

View file

@ -1 +1 @@
export const ellipsize = (str: string, len = 40) => (str.length > len ? `${str.slice(0, len - 1)}` : str);
export const ellipsize = (str: string, len: number) => (str.length > len ? `${str.slice(0, len - 1)}` : str);