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 | |
| parent | 0b00108c3eab73420c5b03cbe603b865276e13e8 (diff) | |
| download | rockbox-f7c97522a874cf8136b8e5e014b1a7abb47bc7fc.zip rockbox-f7c97522a874cf8136b8e5e014b1a7abb47bc7fc.tar.gz rockbox-f7c97522a874cf8136b8e5e014b1a7abb47bc7fc.tar.bz2 rockbox-f7c97522a874cf8136b8e5e014b1a7abb47bc7fc.tar.xz | |
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')
| -rw-r--r-- | apps/gui/list.c | 49 | ||||
| -rw-r--r-- | apps/gui/list.h | 10 | ||||
| -rw-r--r-- | apps/gui/textarea.c | 5 |
3 files changed, 57 insertions, 7 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index d566dab..cd5af40 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); diff --git a/apps/gui/list.h b/apps/gui/list.h index cb488c2..94a172f 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h @@ -93,6 +93,7 @@ struct gui_list { int nb_items; int selected_item; + bool cursor_flash_state; int start_item; /* the item that is displayed at the top of the screen */ void (*callback_get_item_icon) @@ -236,6 +237,14 @@ extern void gui_list_del_item(struct gui_list * gui_list); (gui_list)->limit_scroll=scroll /* + * One call on 2, the selected lune will either blink the cursor or + * invert/display normal the selected line + * - gui_list : the list structure + */ +extern void gui_list_flash(struct gui_list * gui_list); + + +/* * This part handles as many lists as there are connected screens * (the api is similar to the ones above) * The lists on the screens are synchronized ; @@ -278,6 +287,7 @@ extern void gui_synclist_select_previous_page(struct gui_synclist * lists, extern void gui_synclist_add_item(struct gui_synclist * lists); extern void gui_synclist_del_item(struct gui_synclist * lists); extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll); +extern void gui_synclist_flash(struct gui_synclist * lists); /* * Do the action implied by the given button, diff --git a/apps/gui/textarea.c b/apps/gui/textarea.c index c496026..d8e730f 100644 --- a/apps/gui/textarea.c +++ b/apps/gui/textarea.c @@ -24,10 +24,7 @@ void gui_textarea_clear(struct screen * display) #ifdef HAVE_LCD_BITMAP int y_start = gui_textarea_get_ystart(display); int y_end = gui_textarea_get_yend(display); - - display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); - display->fillrect(0, y_start, display->width, y_end - y_start); - display->set_drawmode(DRMODE_SOLID); + screen_clear_area(display, 0, y_start, display->width, y_end - y_start); display->stop_scroll(); screen_set_ymargin(display, y_start); #else |