diff options
author | Kevin Ferrare <kevin@rockbox.org> | 2005-11-09 01:17:57 +0000 |
---|---|---|
committer | Kevin Ferrare <kevin@rockbox.org> | 2005-11-09 01:17:57 +0000 |
commit | f7c97522a874cf8136b8e5e014b1a7abb47bc7fc (patch) | |
tree | a026afc66a257c065b9308e2436158e76a6b9212 /apps/gui/list.c | |
parent | 0b00108c3eab73420c5b03cbe603b865276e13e8 (diff) |
Fixed the icon for unknown file types on the archos Player, and the bug when removing the last file on the screen in filetree, added some code for playlists integration with multi-screen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7800 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r-- | apps/gui/list.c | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index d566dabfbb..cd5af40a98 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -55,6 +55,7 @@ void gui_list_init(struct gui_list * gui_list, gui_list->start_item = 0; gui_list->limit_scroll = false; gui_list->data=data; + gui_list->cursor_flash_state=false; } void gui_list_set_display(struct gui_list * gui_list, struct screen * display) @@ -68,6 +69,42 @@ void gui_list_set_display(struct gui_list * gui_list, struct screen * display) gui_list_put_selection_in_screen(gui_list, false); } +void gui_list_flash(struct gui_list * gui_list) +{ + struct screen * display=gui_list->display; + gui_list->cursor_flash_state=!gui_list->cursor_flash_state; + int selected_line=gui_list->selected_item-gui_list->start_item; +#ifdef HAVE_LCD_BITMAP + int cursor_xpos=global_settings.scrollbar?1:0; + int line_xpos=display->getxmargin(); + int line_ypos=display->getymargin()+display->char_height*selected_line; + if (global_settings.invert_cursor) + { + display->set_drawmode(DRMODE_COMPLEMENT); + display->fillrect(line_xpos, line_ypos, display->width, + display->char_height); + display->set_drawmode(DRMODE_SOLID); + display->invertscroll(0, selected_line); + } + else + { + if(gui_list->cursor_flash_state) + screen_clear_area(display, cursor_xpos*SCROLLBAR_WIDTH, line_ypos, + CURSOR_WIDTH, CURSOR_HEIGHT); + else + screen_put_cursorxy(display, cursor_xpos, selected_line); + } + display->update_rect(0, line_ypos,display->width, + display->char_height); +#else + if(gui_list->cursor_flash_state) + display->putc(0, selected_line, ' '); + else + screen_put_cursorxy(display, 0, selected_line); + gui_textarea_update(display); +#endif +} + void gui_list_put_selection_in_screen(struct gui_list * gui_list, bool put_from_end) { @@ -117,9 +154,7 @@ void gui_list_draw(struct gui_list * gui_list) text_pos += SCROLLBAR_WIDTH; } if(!draw_cursor) - { icon_pos--; - } else text_pos += CURSOR_WIDTH; @@ -181,7 +216,8 @@ void gui_list_draw(struct gui_list * gui_list) gui_list->callback_get_item_icon(current_item, gui_list->data, &icon); - screen_put_iconxy(display, icon_pos, i, icon); + if(icon) + screen_put_iconxy(display, icon_pos, i, icon); } } #ifdef HAVE_LCD_BITMAP @@ -429,6 +465,13 @@ void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll) gui_list_limit_scroll(&(lists->gui_list[i]), scroll); } +void gui_synclist_flash(struct gui_synclist * lists) +{ + int i; + for(i = 0;i < NB_SCREENS;i++) + gui_list_flash(&(lists->gui_list[i])); +} + bool gui_synclist_do_button(struct gui_synclist * lists, unsigned button) { gui_synclist_limit_scroll(lists, true); |