From 9b6ac01c7b55691b62aab15c3302a46f61972197 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Tue, 6 Sep 2011 13:49:41 +0000 Subject: Lists can now be completly draw using the skin engine! due to lack of user feedback the actual tags may change, hopefully not though. The way it works is the skin specifies a rectangle and a viewport label. For each item in the list that is being displayed all viewports with the specified label are drawn. However, instead of the viewport x/y position being offset from the top left corner like normal they are offset from the rectangle position in the list (so think of them as child-viewports of the rectangle which moves). Normally the rectangle will move down the screen to show a normal list, this can be changed to move across the screen in a grid pattern. The UI viewport is used to bound the items (i.e %Vi() ) Scrolling is completly disabled in all items except the currently selected item. This works well in combination with the %cs tag to show differently styled lists based on the current screen :) New tags: %LT - Get the current items text %LI - Get the current items icon number %Lc - Use as a conditional to determine if the current item is the selected item %LB - BAR TAG to show the scroll bar, params/options like other bar types. It still needs a bit of work though. Use as a conditional to find out if the bar is actually needed %Lb(viewport, width, height [,tile]) - specify the viewport label to draw for each item and the size of each item. if the last param is 'tile' it will form a grid instead of a list example.sbs: %?cs<%Lb(a,100,20)|> %V(0,0,10,-,1)%Vf(aabbcc) %?LB<%LB(0,0,10,185, invert)> %Vi(-,10,0,-,-35,1) %Vl(a,5,5,160,12,1) %s%?Lc<%Vg(00ffaa, ff0000, 000000)%Vs(gradient)%>%>%>%ac>zzzzzzz %LT zzzzz%s%?Lc<%ar%<%<%<> %V(0,185,-,-,1) %s%LT git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30461 a1c6a512-1295-4272-9138-f99709370657 --- lib/skin_parser/tag_table.c | 5 +++++ lib/skin_parser/tag_table.h | 7 +++++++ 2 files changed, 12 insertions(+) (limited to 'lib/skin_parser') diff --git a/lib/skin_parser/tag_table.c b/lib/skin_parser/tag_table.c index db8c2e5557..849e1d92dd 100644 --- a/lib/skin_parser/tag_table.c +++ b/lib/skin_parser/tag_table.c @@ -188,7 +188,12 @@ 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_TITLE_ICON, "Li" , "", SKIN_REFRESH_DYNAMIC }, + { SKIN_TOKEN_LIST_ITEM_ICON, "LI", "", 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 }, { SKIN_TOKEN_VIEWPORT_FGCOLOUR, "Vf" , "s", SKIN_REFRESH_STATIC|NOBREAK }, { SKIN_TOKEN_VIEWPORT_BGCOLOUR, "Vb" , "s", SKIN_REFRESH_STATIC|NOBREAK }, diff --git a/lib/skin_parser/tag_table.h b/lib/skin_parser/tag_table.h index 58c14b5e0b..5a93e36866 100644 --- a/lib/skin_parser/tag_table.h +++ b/lib/skin_parser/tag_table.h @@ -212,6 +212,13 @@ enum skin_token_type { SKIN_TOKEN_DRAW_INBUILTBAR, SKIN_TOKEN_LIST_TITLE_TEXT, SKIN_TOKEN_LIST_TITLE_ICON, + SKIN_TOKEN_LIST_ITEM_CFG, + SKIN_TOKEN_LIST_SELECTED_ITEM_CFG, + SKIN_TOKEN_LIST_ITEM_IS_SELECTED, + SKIN_TOKEN_LIST_ITEM_TEXT, + SKIN_TOKEN_LIST_ITEM_ICON, + SKIN_TOKEN_LIST_NEEDS_SCROLLBAR, + SKIN_TOKEN_LIST_SCROLLBAR, SKIN_TOKEN_LOAD_FONT, -- cgit