Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: yapper on April 26, 2008, 03:04:14 PM

Title: Viewports problem - SOLVED
Post by: yapper on April 26, 2008, 03:04:14 PM
I've just been playing with a slight modification of the cabbiev2 theme, adding viewports and squeezing more information onto the screen.
I've run across a problem where part of the display gets 'wiped' under specific circumstances, revealing the WPS background. I'm sure I've seen this mentioned before, but couldn't find anything when searching the forums.

I've attached 3 screendumps. The first shows the screen before any 'corruption' occurs. The second shows what happens when the volume is altered sufficiently for the volume icon to change (e.g. next/previous section of the bitmap strip gets displayed). The third screendump shows what happens when a seek is done.
WPS code:
Code: [Select]
%wd
%X|wpsbackdrop-160x128x2.bmp|
%P|pb-160x128x2.bmp|
%xl|A|lock-160x128x2.bmp|48|114|2|
%xl|B|battery-160x128x2.bmp|66|115|10|
%xl|C|volume-160x128x2.bmp|87|114|10|
%xl|D|shuffle-160x128x2.bmp|107|115|
%xl|E|repeat-160x128x2.bmp|127|113|4|
%xl|F|playmode-160x128x2.bmp|145|114|5|
%Cl|2|11|s64|s64|
%pb|8|1|159|77|
%?mh<%xdAa|%xdAb>
%?bp<%?bc<%xdBa|%xdBb>|%?bl<|%xdBc|%xdBd|%xdBe|%xdBf|%xdBg|%xdBh|%xdBi|%xdBj>>
%?pv<%xdCa|%xdCb|%xdCc|%xdCd|%xdCe|%xdCf|%xdCg|%xdCh|%xdCi|%xdCj>
%?ps<%xdD>
%?mm<|%xdEa|%xdEb|%xdEc|%xdEd>
%?mp<%xdFa|%xdFb|%xdFc|%xdFd|%xdFe>
%?C<%C>
#Current track name
%V|68|10|91|12|1|0|3|
%s%al%?it<%it|%fn>
#Current artist name
%V|68|22|91|12|1|0|3|
%s%al%?ia<%ia|%?d2<%d2|(root)>>
#Current album name
%V|68|34|91|12|1|0|3|
%s%al%?id<%id|%?d1<%d1|(root)>>
# Codec and bitrate
%V|67|64|91|12|1|0|3|
%al%fc%ar%fbkbps%fv
# Current position within playlist, followed by number of entries in playlist
%V|3|86|155|12|1|0|3|
%pc%ac%pp of %pe%ar%pr
# Next (doh!)
%V|3|98|26|12|1|0|3|
%alNext:
# Next track name, then artist name
%V|30|98|129|12|1|0|3|
%s%?It<%It|%Fn>   %Ia
%V|1|1|1|1|1|0|3|

Commenting-out the "%?pv<%xdCa|..." line prevents the corruption shown in the second screendump, so I'm pretty sure of that link.
Also leaving the WPS (e.g. by hitting Menu) and then returning cause the 'good' original display to be redrawn.

Can anyone offer some pointers on how to resolve this?
Title: Re: Viewports problem
Post by: ZincAlloy on April 26, 2008, 03:11:38 PM
you need to put the icons into a viewport.
Title: Re: Viewports problem
Post by: yapper on April 26, 2008, 03:31:51 PM
Aha!  I would have never guessed that. Thanks.  :)

Edit:
If my interpretation is correct, I could use one viewport for all the icons in the lower right area, and then use the %x tag X offset to position the different icons horizontally within that viewport?
Title: Re: Viewports problem
Post by: AlexP on April 26, 2008, 04:25:37 PM
Yes, within a viewport positioning tags are relative to the viewport top left corner, not the screen.
Title: Re: Viewports problem
Post by: yapper on April 26, 2008, 04:30:53 PM
Thanks  :)

It's obvious now, with hindsight.

Edit: The 'finished' version is in the wiki here: http://www.rockbox.org/wiki/WpsIriverH100