summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-06-30 11:26:33 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-06-30 11:26:33 +0000
commit272f79aa1ada0129eada8cdf427f14a2bc88380b (patch)
treee63d5d35592c784dccc5ecc3ef2951792ee337d4
parentd40d17829f6a3d7b097400fca975a64c7fca09ca (diff)
Fix the bug where the german language would crash the quickscreen on the nano.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17889 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/quickscreen.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index ef1111fe3e..f19f2a1df6 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -107,14 +107,16 @@ static void quickscreen_fix_viewports(struct gui_quickscreen *qs,
vp_icons[screen].height =
vps[screen][QUICKSCREEN_BOTTOM].y - vp_icons[screen].y;
- if (left_width + right_width > display->lcdwidth - CENTER_ICONAREA_WIDTH)
+ if ((left_width + right_width > parent->width - CENTER_ICONAREA_WIDTH) ||
+ (MAX(left_width, right_width)*2 > parent->width - CENTER_ICONAREA_WIDTH))
{
/* scrolling needed */
- int width = (parent->width - CENTER_ICONAREA_WIDTH)/2;
+ int center = (parent->width - CENTER_ICONAREA_WIDTH)/2;
+ int width = MIN(center, MIN(left_width, right_width));
vps[screen][QUICKSCREEN_LEFT].width = width;
vps[screen][QUICKSCREEN_RIGHT].width = width;
vps[screen][QUICKSCREEN_RIGHT].x = parent->x+parent->width - width;
- vp_icons[screen].x = parent->x + width;
+ vp_icons[screen].x = parent->x + center;
vp_icons[screen].width = CENTER_ICONAREA_WIDTH;
}
else
@@ -144,7 +146,7 @@ static void quickscreen_fix_viewports(struct gui_quickscreen *qs,
vps[screen][QUICKSCREEN_BOTTOM].x += pad;
vps[screen][QUICKSCREEN_BOTTOM].width -= pad;
}
- vp_icons[screen].width = vps[screen][QUICKSCREEN_RIGHT].x - width;
+ vp_icons[screen].width = vps[screen][QUICKSCREEN_RIGHT].x - (vps[screen][QUICKSCREEN_LEFT].x+width);
}
}