summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-05-04 10:58:05 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-05-04 10:58:05 +0000
commitdaa8341a13ddc93981d2c2178b183a13b5e08950 (patch)
tree3a4946cb4b66d0e475aa04bdd8fafc5bd4a5b3e5 /apps/gui
parent977ad4b5a185cede164cfab9b52ba808bd7ed560 (diff)
a bit of code cleanup.. use a single function to get the statusbar height (or lack of if its enabled), and remove some gui_textarea stuff which could be done using the splash. (gui_textarea is on the way out)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17350 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/charcell/list.c4
-rw-r--r--apps/gui/list.c2
-rw-r--r--apps/gui/statusbar.c6
-rw-r--r--apps/gui/statusbar.h2
-rw-r--r--apps/gui/viewport.c2
5 files changed, 11 insertions, 5 deletions
diff --git a/apps/gui/charcell/list.c b/apps/gui/charcell/list.c
index 64f2fecbbd..bba688d698 100644
--- a/apps/gui/charcell/list.c
+++ b/apps/gui/charcell/list.c
@@ -54,7 +54,7 @@ void list_draw(struct screen *display, struct viewport *parent,
display->set_viewport(NULL);
lines = display->nb_lines;
- gui_textarea_clear(display);
+ display->clear_display();
start = 0;
end = display->nb_lines;
gui_list->last_displayed_start_item[display->screen_type] =
@@ -126,5 +126,5 @@ void list_draw(struct screen *display, struct viewport *parent,
}
display->update_viewport();
- gui_textarea_update(display);
+ display->update();
}
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 6b4229545d..1e2b682e6e 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -76,7 +76,7 @@ void list_init_viewports(struct gui_synclist *list)
else if (list->parent[i] == vp)
{
viewport_set_defaults(vp, i);
- list->parent[i]->y = global_settings.statusbar?STATUSBAR_HEIGHT:0;
+ list->parent[i]->y = gui_statusbar_height();
list->parent[i]->height = screens[i].height - list->parent[i]->y;
}
}
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index 043fbd3e76..436e3d6cca 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -797,3 +797,9 @@ void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars,
gui_statusbar_draw( &(bars->statusbars[i]), force_redraw );
}
}
+
+int gui_statusbar_height(void)
+{
+ return global_settings.statusbar ? STATUSBAR_HEIGHT : 0;
+}
+
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index 8862620596..989d1cbe3c 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -95,5 +95,5 @@ struct gui_syncstatusbar
extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars);
extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, bool force_redraw);
-
+extern int gui_statusbar_height(void);
#endif /*_GUI_STATUSBAR_H_*/
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 86ecd995ca..fbf520eed7 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -50,7 +50,7 @@ void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
vp->x = 0;
vp->width = screens[screen].width;
- vp->y = global_settings.statusbar?STATUSBAR_HEIGHT:0;
+ vp->y = gui_statusbar_height();
vp->height = screens[screen].height - vp->y;
#ifdef HAVE_LCD_BITMAP
vp->drawmode = DRMODE_SOLID;