1
0
Fork 0
forked from len0rd/rockbox

Rework how the skin gets the list item text to save some ram. Also allow the %LI and %LT tags to take 2 optional parameters to get a different items text/icon:

%LT(offset, nowrap) - get the text for the "being drawn"+offset item (offset being + or -). if the second param is "nowrap" (Without quotes) the text will be blank if the item would need to wrap. Same for the icon
e.g:
%LT(-1)
%LT <<
%LT(1, nowrap)

will display:
Four
Five <<
Six (or nothing if Five is the last item)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30502 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2011-09-11 10:44:17 +00:00
parent 93a600fdab
commit 3d0317a273
6 changed files with 82 additions and 26 deletions

View file

@ -188,9 +188,9 @@ static const struct tag_info legal_tags[] =
{ SKIN_TOKEN_VIEWPORT_CUSTOMLIST, "Vp" , "IC", SKIN_REFRESH_DYNAMIC|NOBREAK },
{ SKIN_TOKEN_LIST_TITLE_TEXT, "Lt" , "", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_LIST_ITEM_TEXT, "LT", "", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_LIST_ITEM_TEXT, "LT", "|IS", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_LIST_TITLE_ICON, "Li" , "", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_LIST_ITEM_ICON, "LI", "", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_LIST_ITEM_ICON, "LI", "|IS", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_LIST_ITEM_CFG, "Lb" , "Sii|S", SKIN_REFRESH_STATIC },
{ SKIN_TOKEN_LIST_ITEM_IS_SELECTED, "Lc" , "", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_LIST_NEEDS_SCROLLBAR, "LB", BAR_PARAMS, SKIN_REFRESH_DYNAMIC },