improve edit/mledit when it is invisible

This commit is contained in:
lixianjing 2019-11-26 11:37:54 +08:00
parent da0e491a3f
commit 7ef09fde40
2 changed files with 2 additions and 0 deletions

View File

@ -340,6 +340,7 @@ static ret_t mledit_on_event(widget_t* widget, event_t* e) {
uint32_t type = e->type;
mledit_t* mledit = MLEDIT(widget);
return_value_if_fail(widget != NULL && mledit != NULL, RET_BAD_PARAMS);
return_value_if_fail(widget->visible, RET_OK);
widget_invalidate(widget, NULL);
switch (type) {

View File

@ -502,6 +502,7 @@ ret_t edit_on_event(widget_t* widget, event_t* e) {
uint32_t type = e->type;
edit_t* edit = EDIT(widget);
return_value_if_fail(widget != NULL && edit != NULL, RET_BAD_PARAMS);
return_value_if_fail(widget->visible, RET_OK);
if (edit->readonly) {
text_edit_set_cursor(edit->model, 0xffffffff);