diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-10-28 06:44:37 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-10-28 06:44:37 +0000 |
commit | bee59000324bfd74a38d6d652dae62fc61b3b344 (patch) | |
tree | 1f210c42661e3f2bc3de3d0e73e0e2c635b43611 | |
parent | a30f25ddd422c3bf39a6c9964b25c3a7b01676b3 (diff) | |
download | rockbox-bee59000324bfd74a38d6d652dae62fc61b3b344.tar.gz rockbox-bee59000324bfd74a38d6d652dae62fc61b3b344.zip |
Allow the x and y pixel values of viewports to be a negative number..
%V|-50|0|-|..... will position that viewport 50 pixels from the right of the display at the top.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23378 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/viewport.c | 6 | ||||
-rw-r--r-- | apps/misc.c | 10 | ||||
-rw-r--r-- | wps/classic_statusbar.sbs | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index f39a299521..9bf0e80179 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -445,7 +445,11 @@ const char* viewport_parse_viewport(struct viewport *vp, | |||
445 | /* X and Y *must* be set */ | 445 | /* X and Y *must* be set */ |
446 | if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y)) | 446 | if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y)) |
447 | return NULL; | 447 | return NULL; |
448 | 448 | /* check for negative values */ | |
449 | if (vp->x < 0) | ||
450 | vp->x += screens[screen].lcdwidth; | ||
451 | if (vp->y < 0) | ||
452 | vp->y += screens[screen].lcdheight; | ||
449 | /* fix defaults */ | 453 | /* fix defaults */ |
450 | if (!LIST_VALUE_PARSED(set, PL_WIDTH)) | 454 | if (!LIST_VALUE_PARSED(set, PL_WIDTH)) |
451 | vp->width = screens[screen].lcdwidth - vp->x; | 455 | vp->width = screens[screen].lcdwidth - vp->x; |
diff --git a/apps/misc.c b/apps/misc.c index 5af57feb11..6be9f8f010 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -945,7 +945,7 @@ const char* parse_list(const char *fmt, uint32_t *set_vals, | |||
945 | const char* p = str, *f = fmt; | 945 | const char* p = str, *f = fmt; |
946 | const char** s; | 946 | const char** s; |
947 | int* d; | 947 | int* d; |
948 | bool set; | 948 | bool set, is_negative; |
949 | int i=0; | 949 | int i=0; |
950 | 950 | ||
951 | va_start(ap, str); | 951 | va_start(ap, str); |
@@ -973,7 +973,13 @@ const char* parse_list(const char *fmt, uint32_t *set_vals, | |||
973 | break; | 973 | break; |
974 | 974 | ||
975 | case 'd': /* int */ | 975 | case 'd': /* int */ |
976 | is_negative = false; | ||
976 | d = va_arg(ap, int*); | 977 | d = va_arg(ap, int*); |
978 | if (*p == '-' && isdigit(*(p+1))) | ||
979 | { | ||
980 | is_negative = true; | ||
981 | p++; | ||
982 | } | ||
977 | if (!isdigit(*p)) | 983 | if (!isdigit(*p)) |
978 | { | 984 | { |
979 | if (!set_vals || *p != '-') | 985 | if (!set_vals || *p != '-') |
@@ -987,6 +993,8 @@ const char* parse_list(const char *fmt, uint32_t *set_vals, | |||
987 | while (isdigit(*p)) | 993 | while (isdigit(*p)) |
988 | *d = (*d * 10) + (*p++ - '0'); | 994 | *d = (*d * 10) + (*p++ - '0'); |
989 | set = true; | 995 | set = true; |
996 | if (is_negative) | ||
997 | *d *= -1; | ||
990 | } | 998 | } |
991 | 999 | ||
992 | break; | 1000 | break; |
diff --git a/wps/classic_statusbar.sbs b/wps/classic_statusbar.sbs index 23e6e144b5..22fa9e5b87 100644 --- a/wps/classic_statusbar.sbs +++ b/wps/classic_statusbar.sbs | |||
@@ -35,5 +35,5 @@ | |||
35 | 35 | ||
36 | 36 | ||
37 | # Clock on RTC able targets, and disk access | 37 | # Clock on RTC able targets, and disk access |
38 | %V|140|0|-|8|0|-|-| # The 140 is (LCD_WIDTH-(6 letters * 6 pixels)) | 38 | %V|-36|0|-|8|0|-|-| # align on the right with room for 6 SYSFONT digits |
39 | %?ca<%?St|time format|<%cH|%cI>:%cM|--:-->%?lh<*|> | 39 | %?ca<%?St|time format|<%cH|%cI>:%cM|--:-->%?lh<*|> |