Index: apps/gui/skin_engine/skin_display.c
===================================================================
--- apps/gui/skin_engine/skin_display.c (revision 24725)
+++ apps/gui/skin_engine/skin_display.c (working copy)
@@ -176,6 +176,7 @@
int start_item = MAX(0, cur_playlist_pos + viewer->start_offset);
int i;
struct wps_token token;
+ int x, length, alignment = WPS_TOKEN_ALIGN_LEFT;
struct mp3entry *pid3;
#if CONFIG_CODEC == SWCODEC
@@ -228,6 +229,13 @@
}
switch (viewer->lines[line].tokens[j])
{
+ case WPS_TOKEN_ALIGN_CENTER:
+ case WPS_TOKEN_ALIGN_LEFT:
+ case WPS_TOKEN_ALIGN_LEFT_RTL:
+ case WPS_TOKEN_ALIGN_RIGHT:
+ case WPS_TOKEN_ALIGN_RIGHT_RTL:
+ alignement = viewer->lines[line].tokens[j];
+ break;
case WPS_TOKEN_STRING:
case WPS_TOKEN_CHARACTER:
snprintf(tempbuf, sizeof(tempbuf), "%s",
@@ -260,8 +268,29 @@
gwps->display->puts_scroll(0, (i-start_item), buf );
}
else
- {
- gwps->display->putsxy(0, (i-start_item)*line_height, buf );
+ {
+ int vpwidth = viewer->vp.width;
+ length = gwps->display->getstringsize(bufm NULL, NULL);
+ if (length >= vpwidth)
+ x = 0;
+ else
+ {
+ switch (alignment)
+ {
+ case WPS_TOKEN_ALIGN_CENTER:
+ x = (vpwidth-length)/2;
+ break;
+ case WPS_TOKEN_ALIGN_LEFT:
+ x = 0;
+ break;
+ case WPS_TOKEN_ALIGN_LEFT_RTL:
+ case WPS_TOKEN_ALIGN_RIGHT:
+ x = width = length;
+ break;
+ case WPS_TOKEN_ALIGN_RIGHT_RTL:
+ }
+ }
+ gwps->display->putsxy(x, (i-start_item)*line_height, buf );
}
}
}