summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-04-18 13:27:25 +0200
committerThomas Martitz <kugel@rockbox.org>2014-04-18 13:27:25 +0200
commit532b8141ab24f386e35f389277b4f3bc67211ed5 (patch)
tree7c26eb33592632aac782044f28b09ea60d976230 /apps/gui/skin_engine
parent35b4ba851344dec00d8af7bdac20ed337e100917 (diff)
downloadrockbox-532b8141ab24f386e35f389277b4f3bc67211ed5.tar.gz
rockbox-532b8141ab24f386e35f389277b4f3bc67211ed5.zip
skin_engine: Make %Vs affect the whole line.
Previously %Vs styles only took effect upon the first character of text, i.e. on the right if the line is %arXXX. Now the style is applied for the whole line width. Fixes FS#12973. Change-Id: I95f2cc76a90bfc0779e5a667d5bfa54c33896c89
Diffstat (limited to 'apps/gui/skin_engine')
-rwxr-xr-xapps/gui/skin_engine/skin_display.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 60557bba0d..501d3a305a 100755
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -604,15 +604,15 @@ void write_line(struct screen *display, struct align_pos *format_align,
center_xpos = (viewport_width-center_width)/2;
right_xpos = viewport_width-right_width;
#endif
- /* print aligned strings */
- if (left_width != 0)
- display->put_line(0, line, linedes, "$t", format_align->left);
-
- if (center_width != 0)
- display->put_line(center_xpos, line, linedes, "$t", format_align->center);
-
- if (right_width != 0)
- display->put_line(right_xpos, line, linedes, "$t", format_align->right);
+ /* print aligned strings. print whole line at once so that %Vs works
+ * across the full viewport width */
+ char *left = format_align->left ?: "";
+ char *center = format_align->center ?: "";
+ char *right = format_align->right ?: "";
+
+ display->put_line(0, line, linedes, "$t$*s$t$*s$t", left,
+ center_xpos - left_width, center,
+ right_xpos - (center_xpos + center_width), right);
}
}