Index: apps/gui/usb_screen.c =================================================================== --- apps/gui/usb_screen.c (revision 26196) +++ apps/gui/usb_screen.c (working copy) @@ -38,6 +38,7 @@ #include "led.h" #include "appevents.h" #include "usb_screen.h" +#include "scrollbar.h" #ifdef HAVE_LCD_BITMAP #include "bitmaps/usblogo.h" @@ -56,6 +57,8 @@ static bool usb_hid; #endif +#define USB_BUTTON_TIMEOUT (HZ/10) + #ifndef SIMULATOR static int handle_usb_events(void) @@ -83,7 +86,7 @@ else #endif { - button = button_get_w_tmo(HZ/2); + button = button_get_w_tmo(USB_BUTTON_TIMEOUT); /* hid emits the event in get_action */ send_event(GUI_EVENT_ACTIONUPDATE, NULL); } @@ -185,6 +188,12 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar) { int i; + static int image_pos[NB_SCREENS] = {0}; + static int diff[NB_SCREENS] = {5, +#if NB_SCREENS > 1 + 5 +#endif + }; FOR_NB_SCREENS(i) { struct screen *screen = &screens[i]; @@ -194,7 +203,6 @@ #ifdef HAVE_LCD_BITMAP struct viewport *logo = &usb_screen_vps->logo; #endif - screen->set_viewport(parent); screen->clear_viewport(); screen->backlight_on(); @@ -204,14 +212,22 @@ #ifdef HAVE_REMOTE_LCD if (i == SCREEN_REMOTE) { - screen->bitmap(remote_usblogo, 0, 0, logo->width, - logo->height); + struct bitmap bm = {logo->width, logo->height, FORMAT_NATIVE, 0, (char*)remote_usblogo}; + gui_bitmap_scrollbar_draw(&screens[i], &bm, 0, 0, logo->width, + logo->height, logo->width, 0, image_pos[i], HORIZONTAL); + image_pos[i] += diff[i]; + if (image_pos[i] > logo->width || image_pos[i] < 0) + diff[i] *= -1; } else #endif { - screen->transparent_bitmap(usblogo, 0, 0, logo->width, - logo->height); + struct bitmap bm = {logo->width, logo->height, FORMAT_NATIVE, 0, (char*)usblogo}; + gui_bitmap_scrollbar_draw(&screens[i], &bm, 0, 0, logo->width, + logo->height, logo->width, 0, image_pos[i], HORIZONTAL); + image_pos[i] += diff[i]; + if (image_pos[i] > logo->width || image_pos[i] < 0) + diff[i] *= -1; #ifdef USB_ENABLE_HID if (usb_hid) { @@ -278,7 +294,7 @@ { usb_screens_draw(usb_screen_vps_ar); #ifdef SIMULATOR - if (button_get_w_tmo(HZ/2)) + if (button_get_w_tmo(USB_BUTTON_TIMEOUT)) break; send_event(GUI_EVENT_ACTIONUPDATE, NULL); #else