properties,shortcuts_view: enable the theme while showing list.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24092 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Teruaki Kawashima 2009-12-21 13:32:43 +00:00
parent 847ac057af
commit a2fc641570
4 changed files with 54 additions and 13 deletions

View file

@ -676,6 +676,10 @@ static const struct plugin_api rockbox_api = {
#endif
crc_32,
open_utf8,
#ifdef HAVE_LCD_BITMAP
viewportmanager_theme_enable,
viewportmanager_theme_undo,
#endif
};
int plugin_load(const char* plugin, const void* parameter)

View file

@ -135,7 +135,7 @@ void* plugin_get_buffer(size_t *buffer_size);
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
#define PLUGIN_API_VERSION 177
#define PLUGIN_API_VERSION 178
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
@ -855,6 +855,11 @@ struct plugin_api {
#endif
unsigned (*crc_32)(const void *src, unsigned len, unsigned crc32);
int (*open_utf8)(const char* pathname, int flags);
#ifdef HAVE_LCD_BITMAP
void (*viewportmanager_theme_enable)(enum screen_type screen, bool enable,
struct viewport *viewport);
void (*viewportmanager_theme_undo)(enum screen_type screen, bool force_redraw);
#endif
};
/* plugin header */

View file

@ -272,8 +272,11 @@ static const char * get_props(int selected_item, void* data,
enum plugin_status plugin_start(const void* parameter)
{
struct gui_synclist properties_lists;
#ifdef HAVE_LCD_BITMAP
int i;
#endif
int button;
bool quit = false;
bool quit = false, usb = false;
char file[MAX_PATH];
if(!parameter) return PLUGIN_ERROR;
rb->strcpy(file, (const char *) parameter);
@ -319,6 +322,11 @@ enum plugin_status plugin_start(const void* parameter)
return PLUGIN_OK;
}
#ifdef HAVE_LCD_BITMAP
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_enable(i, true, NULL);
#endif
rb->gui_synclist_init(&properties_lists, &get_props, file, false, 1, NULL);
rb->gui_synclist_set_title(&properties_lists, its_a_dir ?
"Directory properties" :
@ -331,7 +339,8 @@ enum plugin_status plugin_start(const void* parameter)
while(!quit)
{
button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
button = rb->get_action(CONTEXT_LIST, HZ);
/* HZ so the status bar redraws corectly */
if (rb->gui_synclist_do_button(&properties_lists,&button,LIST_WRAP_ON))
continue;
switch(button)
@ -341,9 +350,18 @@ enum plugin_status plugin_start(const void* parameter)
break;
default:
if (rb->default_event_handler(button) == SYS_USB_CONNECTED)
return PLUGIN_USB_CONNECTED;
{
quit = true;
usb = true;
}
break;
}
}
return PLUGIN_OK;
#ifdef HAVE_LCD_BITMAP
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_undo(i, false);
#endif
return usb? PLUGIN_USB_CONNECTED: PLUGIN_OK;
}

View file

@ -58,7 +58,8 @@ enum sc_list_action_type draw_sc_list(struct gui_synclist *gui_sc)
while (true) {
/* user input */
button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK);
button = rb->get_action(CONTEXT_LIST, HZ);
/* HZ so the status bar redraws corectly */
if (rb->gui_synclist_do_button(gui_sc, &button,
LIST_WRAP_UNLESS_HELD)) {
/* automatic handling of user input.
@ -194,6 +195,9 @@ bool ends_with(char *string, char *suffix)
enum plugin_status plugin_start(const void* void_parameter)
{
#ifdef HAVE_LCD_BITMAP
int i;
#endif
bool leave_loop;
/* This is a viewer, so a parameter must have been specified */
@ -222,10 +226,20 @@ enum plugin_status plugin_start(const void* void_parameter)
return PLUGIN_OK;
}
#ifdef HAVE_LCD_BITMAP
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_enable(i, true, NULL);
#endif
do {
/* Display a menu to choose between the entries */
leave_loop = list_sc();
} while (!leave_loop);
#ifdef HAVE_LCD_BITMAP
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_undo(i, false);
#endif
return usb_connected ? PLUGIN_USB_CONNECTED : PLUGIN_OK;
}