Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Thoughts on FS#12124 - drawing the lists with the skin engine
« previous next »
  • Print
Pages: [1]

Author Topic: Thoughts on FS#12124 - drawing the lists with the skin engine  (Read 837 times)

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Thoughts on FS#12124 - drawing the lists with the skin engine
« on: July 04, 2011, 12:49:22 AM »
copy from the dev mailing list to get more eyes:


Hi all,
I'm hoping to have this patch in git ( :) ) before the next release so
I want to get some feedback on how this patch works and what more
needs to be done.

This patch allows themers to draw the all the lists with the skin
engine instead of using the inbuilt standard list (and with some magic
you can draw different lists with different skins, or even with the
inbuilt code.)
Basically how it works is you define a set of viewports (all with a
single label) which will be drawn once for each list item, these are
all drawn as children in a specified rectangle.

example from the tracker:

=======%========
%Lb(a,100,20)                  # This says to draw viewports labeled
'a' in a rectangle 100wide x 20 high
%Vi(-,0,0,-,-35,1)              # Setup the UI viewport, nothing special here
%Vl(a,5,5,-,12,1)              # Setup the viewport to draw for each
item, x,y,width,height here are relative to the position of the
rectangle it is drawn in.
%?Lc<%>%>%>>%ac%LT # Stuff to actually draw, in this case it is the
list text centered and show ">>" if it is the current selection.
=======%========

Now, because the same viewports are drawn more than once per screen
currently no scrolling works. I'm going to fix this by drawing the
selected item Last (so the viewport doesn't move again) and by
allowing you to specify a different viewport label to draw for the
selected item *which doesn't need to have the same rectangle size*
(which should make some nice themes).

OK, so things to talk about:
1) Obviously, is this actually wanted? I think so and the code is
pretty small so it bin/ram delta shouldn't be an issue. (And it looks
pretty cool)
2) Added skin tags:
   %LT - the list item text
   %LI - list items icon number
   %Lb(label,width,height,options) - configure the list.. this line
im not too happy with, but what better is there?
   %Lc - is the currently drawn item the selected item?
   %LB(bar params) - draw the scrollbar (this isnt currently working
but will be)
3) How do we change %Lb() to handle the label to draw for the current
selection? Do we just duplicate that tag completely for it?
4) It can draw items is a simple vertical list, or in a grid pattern,
what other styles should I make possible?
5) What other tags would make this more useful? I immediatly think of
some drawing primatives (i.e draw a rectangle, colour a rectangle,
etc).

anything else?

questions, comments?
Jonathan
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Thoughts on FS#12124 - drawing the lists with the skin engine
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.045 seconds with 15 queries.