mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
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
This commit is contained in:
parent
fca6b63ef7
commit
db8415c99e
11 changed files with 317 additions and 476 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -134,6 +134,13 @@ extern void gui_list_init(struct gui_list * gui_list,
|
|||
#define gui_list_set_nb_items(gui_list, nb) \
|
||||
(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
|
||||
|
|
@ -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) \
|
||||
|
|
|
|||
|
|
@ -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" */
|
||||
|
|
|
|||
|
|
@ -70,6 +70,9 @@ struct gui_statusbar
|
|||
struct screen * display;
|
||||
};
|
||||
|
||||
|
||||
extern struct gui_syncstatusbar statusbars;
|
||||
|
||||
/*
|
||||
* Initializes a status bar
|
||||
* - bar : the bar to initialize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue