change the selection block to square in list_view icon mode.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1042 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
523980b430
commit
5837cd792c
|
@ -104,7 +104,9 @@ static void rtgui_event_dump(rt_thread_t tid, rtgui_event_t* event)
|
|||
|
||||
if (event->sender != RT_NULL) sender = event->sender->name;
|
||||
|
||||
if (event->type == RTGUI_EVENT_TIMER)
|
||||
if ((event->type == RTGUI_EVENT_TIMER) ||
|
||||
(event->type == RTGUI_EVENT_UPDATE_BEGIN) ||
|
||||
(event->type == RTGUI_EVENT_UPDATE_END))
|
||||
{
|
||||
/* don't dump timer event */
|
||||
return ;
|
||||
|
@ -127,6 +129,8 @@ static void rtgui_event_dump(rt_thread_t tid, rtgui_event_t* event)
|
|||
struct rtgui_event_kbd *ekbd = (struct rtgui_event_kbd*) event;
|
||||
if (ekbd->wid != RT_NULL)
|
||||
rt_kprintf("win: %s", ekbd->wid->title);
|
||||
if (RTGUI_KBD_IS_UP(ekbd)) rt_kprintf(", up");
|
||||
else rt_kprintf(", down");
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ static void rtgui_list_view_onicondraw(struct rtgui_list_view* view, struct rtgu
|
|||
drawing_rect.x2 = image->w;
|
||||
drawing_rect.y2 = image->h;
|
||||
rtgui_rect_moveto_align(&item_rect, &drawing_rect, RTGUI_ALIGN_CENTER_HORIZONTAL);
|
||||
drawing_rect.y1 += 3; drawing_rect.y2 += 3;
|
||||
drawing_rect.y1 += 5; drawing_rect.y2 += 5;
|
||||
rtgui_image_blit(view->items[item_index].image, dc, &drawing_rect);
|
||||
|
||||
item_rect.y1 = drawing_rect.y2 + LIST_MARGIN;
|
||||
|
@ -145,7 +145,7 @@ static void rtgui_list_view_update_icon(struct rtgui_list_view* view, rt_uint16_
|
|||
drawing_rect.x2 = image->w;
|
||||
drawing_rect.y2 = image->h;
|
||||
rtgui_rect_moveto_align(&item_rect, &drawing_rect, RTGUI_ALIGN_CENTER_HORIZONTAL);
|
||||
drawing_rect.y1 += 3; drawing_rect.y2 += 3;
|
||||
drawing_rect.y1 += 5; drawing_rect.y2 += 5;
|
||||
rtgui_image_blit(view->items[old_item].image, dc, &drawing_rect);
|
||||
|
||||
/* draw text */
|
||||
|
@ -576,7 +576,9 @@ static void rtgui_list_view_calc(struct rtgui_list_view* view)
|
|||
|
||||
item_width = (image->w + LIST_MARGIN);
|
||||
if (item_width < (text_width + LIST_MARGIN)) item_width = text_width + LIST_MARGIN;
|
||||
item_height = image->h + 3 + text_height + LIST_MARGIN;
|
||||
item_height = image->h + 8 + text_height + LIST_MARGIN;
|
||||
if (item_width > item_height) item_height = item_width;
|
||||
else item_width = item_height;
|
||||
|
||||
view->row_items = (rtgui_rect_height(rect) - 2 * LIST_MARGIN) / item_height;
|
||||
view->col_items = (rtgui_rect_width(rect) - 2 * LIST_MARGIN) / item_width;
|
||||
|
|
Loading…
Reference in New Issue