diff options
| author | Kevin Ferrare <kevin@rockbox.org> | 2005-10-30 22:34:51 +0000 |
|---|---|---|
| committer | Kevin Ferrare <kevin@rockbox.org> | 2005-10-30 22:34:51 +0000 |
| commit | db8415c99e37b1ee2b152625d36e84cb9bbf690d (patch) | |
| tree | bd4ff98ebf76d79221d0f511daae879c66e78a28 /apps/gui | |
| parent | fca6b63ef7310a36010d843f295e37ec368febf8 (diff) | |
| download | rockbox-db8415c99e37b1ee2b152625d36e84cb9bbf690d.zip rockbox-db8415c99e37b1ee2b152625d36e84cb9bbf690d.tar.gz rockbox-db8415c99e37b1ee2b152625d36e84cb9bbf690d.tar.bz2 rockbox-db8415c99e37b1ee2b152625d36e84cb9bbf690d.tar.xz | |
Partial menus support on remote (only browsing is working, changing option isn't), corrected a bug in gui_list about scrollbar beeing displayed sometimes when it musn't
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7693 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
| -rw-r--r-- | apps/gui/buttonbar.c | 8 | ||||
| -rw-r--r-- | apps/gui/list.c | 6 | ||||
| -rw-r--r-- | apps/gui/list.h | 10 | ||||
| -rw-r--r-- | apps/gui/statusbar.c | 2 | ||||
| -rw-r--r-- | apps/gui/statusbar.h | 3 |
5 files changed, 21 insertions, 8 deletions
diff --git a/apps/gui/buttonbar.c b/apps/gui/buttonbar.c index 1f6d357..0917c51 100644 --- a/apps/gui/buttonbar.c +++ b/apps/gui/buttonbar.c @@ -49,7 +49,6 @@ void gui_buttonbar_draw_button(struct gui_buttonbar * buttonbar, int num) int xpos, ypos, button_width, text_width; int fw, fh; struct screen * display = buttonbar->display; - display->getstringsize("M", &fw, &fh); button_width = display->width/BUTTONBAR_MAX_BUTTONS; @@ -102,6 +101,9 @@ void gui_buttonbar_unset(struct gui_buttonbar * buttonbar) void gui_buttonbar_draw(struct gui_buttonbar * buttonbar) { struct screen * display = buttonbar->display; + screen_has_buttonbar(display, gui_buttonbar_isset(buttonbar)); + if(!global_settings.buttonbar || !display->has_buttonbar) + return; int i; display->setfont(FONT_SYSFIXED); @@ -120,11 +122,9 @@ void gui_buttonbar_draw(struct gui_buttonbar * buttonbar) bool gui_buttonbar_isset(struct gui_buttonbar * buttonbar) { /* If all buttons are unset, the button bar is considered disabled */ - if(!global_settings.buttonbar) - return(false); int i; for(i = 0;i < BUTTONBAR_MAX_BUTTONS;i++) - if(buttonbar->caption[i] != 0) + if(buttonbar->caption[i][0] != 0) return true; return false; } diff --git a/apps/gui/list.c b/apps/gui/list.c index 8c41546..998e7b9 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -102,9 +102,10 @@ void gui_list_draw(struct gui_list * gui_list) /* Adjust the position of icon, cursor, text */ #ifdef HAVE_LCD_BITMAP + display->setfont(FONT_UI); + screen_update_nblines(display); bool draw_scrollbar = (global_settings.scrollbar && display->nb_lines < gui_list->nb_items); - int list_y_start = screen_get_text_y_start(gui_list->display); int list_y_end = screen_get_text_y_end(gui_list->display); @@ -140,9 +141,6 @@ void gui_list_draw(struct gui_list * gui_list) display->width, list_y_end - list_y_start); display->set_drawmode(DRMODE_SOLID); - display->setfont(FONT_UI); - screen_update_nblines(display); - display->stop_scroll(); display->setmargins(text_pos, list_y_start); #else diff --git a/apps/gui/list.h b/apps/gui/list.h index 012251b..cb488c2 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h @@ -135,6 +135,13 @@ extern void gui_list_init(struct gui_list * gui_list, (gui_list)->nb_items = nb /* + * Returns the numbers of items currently in the list + * - gui_list : the list structure to initialize + */ +#define gui_list_get_nb_items(gui_list) \ + (gui_list)->nb_items + +/* * Puts the selection in the screen * - gui_list : the list structure * - put_from_end : if true, selection will be put as close from @@ -161,6 +168,7 @@ extern void gui_list_set_display(struct gui_list * gui_list, #define gui_list_get_sel_pos(gui_list) \ (gui_list)->selected_item + /* * Selects an item in the list * - gui_list : the list structure @@ -251,6 +259,8 @@ extern void gui_synclist_init( ); extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); +#define gui_synclist_get_nb_items(lists) \ + gui_list_get_nb_items(&((lists)->gui_list[0])) extern int gui_synclist_get_sel_pos(struct gui_synclist * lists); #define gui_synclist_get_sel_pos(lists) \ diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index c17a741..0a506b0 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c @@ -84,6 +84,8 @@ STATUSBAR_DISK_WIDTH #define STATUSBAR_TIME_X_END(statusbar_width) statusbar_width-1 +struct gui_syncstatusbar statusbars; + void gui_statusbar_init(struct gui_statusbar * bar) { bar->last_volume = -1; /* -1 means "first update ever" */ diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h index ff44b76..65dd76a 100644 --- a/apps/gui/statusbar.h +++ b/apps/gui/statusbar.h @@ -70,6 +70,9 @@ struct gui_statusbar struct screen * display; }; + +extern struct gui_syncstatusbar statusbars; + /* * Initializes a status bar * - bar : the bar to initialize |