forked from len0rd/rockbox
Stop using the old menu API in the debug menu (using the new api causes massive bin increase, so fake the old api with existing code instead) (onplay.c and plugins are the only parts using th eold api now)
Fix a bug where the menu title was sometimes shown in the system font git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13286 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4eaddc3f85
commit
39a6b5d643
2 changed files with 31 additions and 15 deletions
|
|
@ -88,7 +88,6 @@
|
|||
#endif
|
||||
#include "hwcompat.h"
|
||||
|
||||
#ifndef SIMULATOR
|
||||
static bool dbg_list(char *title, int count, int selection_size,
|
||||
int (*action_callback)(int btn, struct gui_synclist *lists),
|
||||
char* (*dbg_getname)(int item, void * data, char *buffer))
|
||||
|
|
@ -118,7 +117,6 @@ static bool dbg_list(char *title, int count, int selection_size,
|
|||
action_signalscreenchange();
|
||||
return false;
|
||||
}
|
||||
#endif /* SIMULATOR */
|
||||
/*---------------------------------------------------*/
|
||||
/* SPECIAL DEBUG STUFF */
|
||||
/*---------------------------------------------------*/
|
||||
|
|
@ -2293,12 +2291,15 @@ static bool cpu_boost_log(void)
|
|||
return false;
|
||||
}
|
||||
#endif
|
||||
bool debug_menu(void)
|
||||
{
|
||||
int m;
|
||||
bool result;
|
||||
|
||||
static const struct menu_item items[] = {
|
||||
|
||||
|
||||
/****** The menu *********/
|
||||
struct the_menu_item {
|
||||
unsigned char *desc; /* string or ID */
|
||||
bool (*function) (void); /* return true if USB was connected */
|
||||
};
|
||||
static const struct the_menu_item menuitems[] = {
|
||||
#if defined(TOSHIBA_GIGABEAT_F) && !defined(SIMULATOR)
|
||||
{ "LCD Power Off", dbg_lcd_power_off },
|
||||
{ "Button Light modes", dbg_buttonlights },
|
||||
|
|
@ -2372,11 +2373,24 @@ bool debug_menu(void)
|
|||
{"cpu_boost log",cpu_boost_log},
|
||||
#endif
|
||||
};
|
||||
|
||||
m=menu_init( items, sizeof items / sizeof(struct menu_item), NULL,
|
||||
"Debug Menu", NULL, NULL);
|
||||
result = menu_run(m);
|
||||
menu_exit(m);
|
||||
|
||||
return result;
|
||||
int menu_action_callback(int btn, struct gui_synclist *lists)
|
||||
{
|
||||
if (btn == ACTION_STD_OK)
|
||||
{
|
||||
menuitems[gui_synclist_get_sel_pos(lists)].function();
|
||||
gui_synclist_draw(lists);
|
||||
}
|
||||
return btn;
|
||||
}
|
||||
char* dbg_menu_getname(int item, void * data, char *buffer)
|
||||
{
|
||||
(void)data; (void)buffer;
|
||||
return menuitems[item].desc;
|
||||
}
|
||||
bool debug_menu(void)
|
||||
{
|
||||
dbg_list("Debug Menu",ARRAYLEN(menuitems) , 1,
|
||||
menu_action_callback,
|
||||
dbg_menu_getname);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,6 +242,9 @@ static void gui_list_draw_smart(struct gui_list *gui_list)
|
|||
int start, end;
|
||||
bool partial_draw = false;
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
display->setfont(FONT_UI);
|
||||
#endif
|
||||
/* Speed up UI by drawing the changed contents only. */
|
||||
if (gui_list == last_list_displayed[gui_list->display->screen_type]
|
||||
&& gui_list->last_displayed_start_item == gui_list->start_item
|
||||
|
|
@ -313,7 +316,6 @@ static void gui_list_draw_smart(struct gui_list *gui_list)
|
|||
|
||||
/* Adjust the position of icon, cursor, text for the list */
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
display->setfont(FONT_UI);
|
||||
gui_textarea_update_nblines(display);
|
||||
bool draw_scrollbar;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue