summaryrefslogtreecommitdiffstats
path: root/apps/gui/pitchscreen.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-10-15 21:30:19 +0000
committerThomas Martitz <kugel@rockbox.org>2009-10-15 21:30:19 +0000
commit4004c75fee1e0f7cb7397ac88dce5209b57b8d96 (patch)
treef9562c9a2df2f35d74e441427a8b1ee31f4ea5b5 /apps/gui/pitchscreen.c
parent9c45cf2f468ec80d6dcb5c695f72061e7e34d7d7 (diff)
downloadrockbox-4004c75fee1e0f7cb7397ac88dce5209b57b8d96.tar.gz
rockbox-4004c75fee1e0f7cb7397ac88dce5209b57b8d96.tar.bz2
rockbox-4004c75fee1e0f7cb7397ac88dce5209b57b8d96.zip
Use the center align viewport flag to draw top and bottom text centered.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23197 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/pitchscreen.c')
-rw-r--r--apps/gui/pitchscreen.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/gui/pitchscreen.c b/apps/gui/pitchscreen.c
index 7de65bc36e..33c92e845b 100644
--- a/apps/gui/pitchscreen.c
+++ b/apps/gui/pitchscreen.c
@@ -154,6 +154,9 @@ static void pitchscreen_fix_viewports(struct viewport *parent,
{
pitch_viewports[i] = *parent;
pitch_viewports[i].height = font_height;
+
+ if (i == PITCH_TOP || i == PITCH_BOTTOM)
+ pitch_viewports[i].flags |= VP_FLAG_ALIGN_CENTER;
}
pitch_viewports[PITCH_TOP].y += ICON_BORDER;
@@ -204,7 +207,8 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
int w, h;
bool show_lang_pitch;
- /* "Pitch up/Pitch down" - hide for a small screen */
+ /* "Pitch up/Pitch down" - hide for a small screen,
+ * the text is drawn centered automatically */
if (max_lines >= 5)
{
/* UP: Pitch Up */
@@ -213,11 +217,9 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
ptr = str(LANG_PITCH_UP_SEMITONE);
else
ptr = str(LANG_PITCH_UP);
- display->getstringsize(ptr, &w, &h);
display->clear_viewport();
/* draw text */
- display->putsxy((pitch_viewports[PITCH_TOP].width / 2) -
- (w / 2), 0, ptr);
+ display->putsxy(0, 0, ptr);
display->update_viewport();
/* DOWN: Pitch Down */
@@ -226,11 +228,9 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
ptr = str(LANG_PITCH_DOWN_SEMITONE);
else
ptr = str(LANG_PITCH_DOWN);
- display->getstringsize(ptr, &w, &h);
display->clear_viewport();
/* draw text */
- display->putsxy((pitch_viewports[PITCH_BOTTOM].width / 2) -
- (w / 2), 0, ptr);
+ display->putsxy(0, 0, ptr);
display->update_viewport();
}