Advertisement
Guest User

Untitled

a guest
Feb 17th, 2010
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. Index: apps/gui/skin_engine/skin_display.c
  2. ===================================================================
  3. --- apps/gui/skin_engine/skin_display.c (revision 24725)
  4. +++ apps/gui/skin_engine/skin_display.c (working copy)
  5. @@ -176,6 +176,7 @@
  6. int start_item = MAX(0, cur_playlist_pos + viewer->start_offset);
  7. int i;
  8. struct wps_token token;
  9. + int x, length, alignment = WPS_TOKEN_ALIGN_LEFT;
  10.  
  11. struct mp3entry *pid3;
  12. #if CONFIG_CODEC == SWCODEC
  13. @@ -228,6 +229,13 @@
  14. }
  15. switch (viewer->lines[line].tokens[j])
  16. {
  17. + case WPS_TOKEN_ALIGN_CENTER:
  18. + case WPS_TOKEN_ALIGN_LEFT:
  19. + case WPS_TOKEN_ALIGN_LEFT_RTL:
  20. + case WPS_TOKEN_ALIGN_RIGHT:
  21. + case WPS_TOKEN_ALIGN_RIGHT_RTL:
  22. + alignement = viewer->lines[line].tokens[j];
  23. + break;
  24. case WPS_TOKEN_STRING:
  25. case WPS_TOKEN_CHARACTER:
  26. snprintf(tempbuf, sizeof(tempbuf), "%s",
  27. @@ -260,8 +268,29 @@
  28. gwps->display->puts_scroll(0, (i-start_item), buf );
  29. }
  30. else
  31. - {
  32. - gwps->display->putsxy(0, (i-start_item)*line_height, buf );
  33. + {
  34. + int vpwidth = viewer->vp.width;
  35. + length = gwps->display->getstringsize(bufm NULL, NULL);
  36. + if (length >= vpwidth)
  37. + x = 0;
  38. + else
  39. + {
  40. + switch (alignment)
  41. + {
  42. + case WPS_TOKEN_ALIGN_CENTER:
  43. + x = (vpwidth-length)/2;
  44. + break;
  45. + case WPS_TOKEN_ALIGN_LEFT:
  46. + x = 0;
  47. + break;
  48. + case WPS_TOKEN_ALIGN_LEFT_RTL:
  49. + case WPS_TOKEN_ALIGN_RIGHT:
  50. + x = width = length;
  51. + break;
  52. + case WPS_TOKEN_ALIGN_RIGHT_RTL:
  53. + }
  54. + }
  55. + gwps->display->putsxy(x, (i-start_item)*line_height, buf );
  56. }
  57. }
  58. }
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement