diff --git a/rtgui/common/rtgui_theme.c b/rtgui/common/rtgui_theme.c index 28d5215573eee1027ad056c2053705e1bee9685e..b2f0128152d14108f39ccd6040333f5581c71a1d 100644 --- a/rtgui/common/rtgui_theme.c +++ b/rtgui/common/rtgui_theme.c @@ -479,8 +479,8 @@ void rtgui_theme_draw_textbox(rtgui_textbox_t* box) rt_size_t len = rt_strlen(box->text); if (len > 0) { - char *text_mask = rtgui_malloc(len); - rt_memset(text_mask, '*', len); + char *text_mask = rtgui_malloc(len + 1); + rt_memset(text_mask, '*', len + 1); text_mask[len] = 0; rtgui_dc_draw_text(dc, text_mask, &rect); rt_free(text_mask); diff --git a/rtgui/include/rtgui/widgets/filelist_view.h b/rtgui/include/rtgui/widgets/filelist_view.h index c34b1e20320ae2abba94ea6db1445090ba896924..e3fab1fc904a4f7413f94680b9461a722aeaccf6 100644 --- a/rtgui/include/rtgui/widgets/filelist_view.h +++ b/rtgui/include/rtgui/widgets/filelist_view.h @@ -53,4 +53,6 @@ void rtgui_filelist_view_clear(rtgui_filelist_view_t* view); rt_bool_t rtgui_filelist_view_event_handler(struct rtgui_widget* widget, struct rtgui_event* event); void rtgui_filelist_view_set_directory(rtgui_filelist_view_t* view, const char* directory); +void rtgui_filelist_get_fullpath(rtgui_filelist_view_t* view, char* path, rt_size_t len); + #endif diff --git a/rtgui/widgets/filelist_view.c b/rtgui/widgets/filelist_view.c index eeba921d9fc9a4704e77c00250ce5c928c322443..75b75ac8f15c6b9e58636eeb6b91e091d6dc18e2 100644 --- a/rtgui/widgets/filelist_view.c +++ b/rtgui/widgets/filelist_view.c @@ -683,3 +683,11 @@ __return: /* update view */ rtgui_widget_update(RTGUI_WIDGET(view)); } + +void rtgui_filelist_get_fullpath(rtgui_filelist_view_t* view, char* path, rt_size_t len) +{ + RT_ASSERT(view != RT_NULL); + + rt_sprintf(path, "%s/%s", view->current_directory, + view->items[view->current_item].name); +} \ No newline at end of file diff --git a/rtgui/widgets/label.c b/rtgui/widgets/label.c index 68e41d0747c127df63433e56de52b1b105b776e5..574ec7cea75223908e74580f4e060d7372833c45 100644 --- a/rtgui/widgets/label.c +++ b/rtgui/widgets/label.c @@ -110,4 +110,7 @@ void rtgui_label_set_text(rtgui_label_t* label, const unsigned char* text) if (text != RT_NULL) label->text = (unsigned char*)rt_strdup((const char*)text); else label->text = RT_NULL; + + /* update widget */ + rtgui_theme_draw_label(label); }