summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-04-16 16:06:13 +0200
committerThomas Martitz <kugel@rockbox.org>2014-01-07 14:13:48 +0100
commit49780944809651f28e8135bf6d67dcd8ceeb2585 (patch)
tree4893467ebcf509eeab6990905511f40c852b7f03 /apps
parent9a4686b563ac9e27615e1032792bd9878bb291f7 (diff)
downloadrockbox-49780944809651f28e8135bf6d67dcd8ceeb2585.tar.gz
rockbox-49780944809651f28e8135bf6d67dcd8ceeb2585.zip
lcd-common: Remove support for custom line heights from viewport.
Since scrolling is now pixel-based this is not necessary anymore. custom line height is handled by put_line() but can also possible to implement with lcd_puts_scroll_func(). Change-Id: Iee9b12bf99afac93d95d2a1a6f5d5b4db237b21c
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/viewport.c5
-rw-r--r--apps/menus/time_menu.c2
-rw-r--r--apps/plugins/lib/pluginlib_touchscreen.c3
3 files changed, 3 insertions, 7 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 0b5441e02b..b91c7441dd 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -225,9 +225,7 @@ static bool is_theme_enabled(enum screen_type screen)
225int viewport_get_nb_lines(const struct viewport *vp) 225int viewport_get_nb_lines(const struct viewport *vp)
226{ 226{
227#ifdef HAVE_LCD_BITMAP 227#ifdef HAVE_LCD_BITMAP
228 if (!vp->line_height) 228 return vp->height/font_get(vp->font)->height;
229 return vp->height/font_get(vp->font)->height;
230 return vp->height/vp->line_height;
231#else 229#else
232 (void)vp; 230 (void)vp;
233 return 2; 231 return 2;
@@ -322,7 +320,6 @@ void viewport_set_fullscreen(struct viewport *vp,
322 set_default_align_flags(vp); 320 set_default_align_flags(vp);
323#endif 321#endif
324 vp->font = screens[screen].getuifont(); 322 vp->font = screens[screen].getuifont();
325 vp->line_height = 0; /* calculate from font height */
326 vp->drawmode = DRMODE_SOLID; 323 vp->drawmode = DRMODE_SOLID;
327#if LCD_DEPTH > 1 324#if LCD_DEPTH > 1
328#ifdef HAVE_REMOTE_LCD 325#ifdef HAVE_REMOTE_LCD
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c
index 1eb4bd68cc..9ef4f7323c 100644
--- a/apps/menus/time_menu.c
+++ b/apps/menus/time_menu.c
@@ -265,7 +265,7 @@ int time_screen(void* ignored)
265 /* force time to be drawn centered */ 265 /* force time to be drawn centered */
266 clock_vps[i].flags |= VP_FLAG_ALIGN_CENTER; 266 clock_vps[i].flags |= VP_FLAG_ALIGN_CENTER;
267 267
268 font_h = clock_vps[i].line_height ?: (int)font_get(clock_vps[i].font)->height; 268 font_h = font_get(clock_vps[i].font)->height;
269 nb_lines -= 2; /* at least 2 lines for menu */ 269 nb_lines -= 2; /* at least 2 lines for menu */
270 if (nb_lines > 4) 270 if (nb_lines > 4)
271 nb_lines = 4; 271 nb_lines = 4;
diff --git a/apps/plugins/lib/pluginlib_touchscreen.c b/apps/plugins/lib/pluginlib_touchscreen.c
index 095750740e..5903b7c7a9 100644
--- a/apps/plugins/lib/pluginlib_touchscreen.c
+++ b/apps/plugins/lib/pluginlib_touchscreen.c
@@ -140,8 +140,7 @@ void touchbutton_draw(struct touchbutton *data, int num_buttons) {
140 */ 140 */
141 lcd->set_viewport(&data[i].vp); 141 lcd->set_viewport(&data[i].vp);
142 142
143 /* Set line_height to height, then it'll center for us */ 143 /* TODO: Center text vert*/
144 data[i].vp.line_height = data[i].vp.height;
145 data[i].vp.flags |= VP_FLAG_ALIGN_CENTER; 144 data[i].vp.flags |= VP_FLAG_ALIGN_CENTER;
146 145
147 /* If the width offset was 0, use a scrolling puts, else center and 146 /* If the width offset was 0, use a scrolling puts, else center and