Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: DustyTill on September 17, 2017, 02:47:11 PM

Title: Next line instead of scrolling
Post by: DustyTill on September 17, 2017, 02:47:11 PM
Hi, is there a way for a text in the wps to go to the next line instead of scrolling when they're too long?
Title: Re: Next line instead of scrolling
Post by: Bilgus on September 17, 2017, 06:26:46 PM
First off I recommend reading about Custom WPS in your device manual

specifically about %s and %ss
https://www.rockbox.org/wiki/CustomWPS#Other_Tags
%ss(start, length, tag)   Get a substring of another tags value



Do note:
 this link is out of date the one in manual will be more up to date..
 both DO contain inaccuracies.

That being said you could probably (ab)use the theme parser something like this..
%?if(%ss(0, 10, %it), =, %it)<%al%it|%al%ss(0, 10, %it)>
%?if(%ss(10, 10, %it), =, %ss(10, 10, %it))<%ss(10, 10, %it)|%s%ac%?ia<%ia|Unknown Artist>>

that breaks down like this:
%?if(%ss(0, 10, %it), =, %it)<%al%it                       |      %al%ss(0, 10, %it)>
if string < 11                       then display track name (else) then display 10 chars

%?if(%ss(10, 10, %it), =, %ss(10, 10, %it))<%ss(10, 10, %it)           |     %s%ac%?ia<%ia|Unknown Artist>>
if string > 10                                                 then display 10 more  (else) then display artist name

I 'THINK' you could probably carry it out further with..
%?if(%ss(20, 10, %it), =, %ss(20, 10, %it))<%ss(20, 10, %it)|%s%ac%?ia<%ia|Unknown Artist>>

this seems like it could get complicated quickly depending how many variables you wanted to do this with.