On 9 October 2011 18:38, Jonathan Gordon <jdgo...@gmail.com> wrote:
> 30min of fiddling around, attached is the screenshot from the e200 sim
> and the patch to do it, notice there is no code needed anywhere
> outside of the skin engine (infact its only done there because that
> pulls in the generated .sbs if none is specified). No actual code
> needs changing.
>
> Notes about the screenshot:
> * I'm not sure why the images arent being displayed, that might be a
> skin engine bug, more likely PEBCAK.
> * Gradient isnt completly setup in that example
>
> Now, I haven't seen screenshots from kugels patch, but if it colours
> the whole line instead of just the text, then that can be fixed with
> minor changes to the skin engine (wanted to do that anyway). Though it
> requires the lcd driver get a draw more which is "use the current
> pixels for the transparent pixels instead of the backdrop image) which
> IIUC amiconn has mentioned he wants to add for a while now. If kugels
> patch is the same as that screenshot then the above is still something
> which should be done :) (hardly a reason to not go by this
> implementation anyway).
>
>
> With a bit more fiddling this could be *easily* extended to *any*
> skinned list theme by just fiddling with the Lb() tag.
>
> Jonathan
>

DAMMIT! pressed send before ataching the patch
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c
index ad9a391..d2b3a0d 100644
--- a/apps/gui/statusbar-skinned.c
+++ b/apps/gui/statusbar-skinned.c
@@ -192,7 +192,7 @@ void sb_skin_set_update_delay(int delay)
  */
 char* sb_create_from_settings(enum screen_type screen)
 {
-    static char buf[128];
+    static char buf[512];
     char *ptr, *ptr2;
     int len, remaining = sizeof(buf);
     int bar_position = statusbar_position(screen);
@@ -263,6 +263,21 @@ char* sb_create_from_settings(enum screen_type screen)
         len = snprintf(ptr, remaining, "%%ax%%Vi(-,0,%d,-,%d,1)\n", 
                        y, height);
     }
+    remaining -= len;
+    ptr += len;
+    /* now do the skin list */
+    int font_height = font_get(global_status.font_id[screen])->height;
+    int padding = 6; // get it from wherever
+    int icon_size = get_icon_width(screen);
+    len = snprintf(ptr, remaining, 
+        "%%V(0,0,0,0,0)\n" /* %Lb() needs to be in a viewport */
+        "%%Lb(a,%d,%d)\n" /* setup the list viewport rectangle */
+        "%%Vl(a,0,%d,%d,%d,-)\n%%xl(i,__list_icons__,%d,%d)\n%%?LI<%%LI%%xd(i,%%LI)>\n" /* the icon */
+        "%%Vl(a,%d,%d,%d,%d,1)\n%%?Lc<%%Vs(gradient)%%s>%%LT\n" /* draw the text */,
+        screens[screen].getwidth(), font_height+padding*2,
+        padding, icon_size, icon_size,icon_size, icon_size,
+        icon_size+2, padding, screens[screen].getwidth() - icon_size+2 - icon_size, font_height);
+    printf("%s", buf);
     return buf;
 }
 

Reply via email to