diff options
author | Al Poole <netstar@gmail.com> | 2017-10-21 01:28:06 +0100 |
---|---|---|
committer | Al Poole <netstar@gmail.com> | 2017-10-21 01:28:06 +0100 |
commit | eeb25519b3b56094aa889d99a15dbe17f8f61786 (patch) | |
tree | 09acbf646e99fbaadb3106ff079b3151d3989296 /src/lib/elementary | |
parent | 613649a39fe1481af494f33542c020b0b632183a (diff) |
elm_code_widget: make sure the widget is cleared properly.
This ensures the widget is clearer if the file has been cleared.
@fix T6185
Diffstat (limited to 'src/lib/elementary')
-rw-r--r-- | src/lib/elementary/elm_code_widget.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c index aa160f803f..a99eba1aca 100644 --- a/src/lib/elementary/elm_code_widget.c +++ b/src/lib/elementary/elm_code_widget.c | |||
@@ -463,6 +463,19 @@ _elm_code_widget_refresh(Elm_Code_Widget *widget, Elm_Code_Line *line) | |||
463 | } | 463 | } |
464 | 464 | ||
465 | static void | 465 | static void |
466 | _elm_code_widget_clear(Elm_Code_Widget *widget) | ||
467 | { | ||
468 | Elm_Code_Widget_Data *pd; | ||
469 | Evas_Object *grid; | ||
470 | |||
471 | pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); | ||
472 | EINA_LIST_FREE(pd->grids, grid) | ||
473 | { | ||
474 | evas_object_del(grid); | ||
475 | } | ||
476 | } | ||
477 | |||
478 | static void | ||
466 | _elm_code_widget_fill(Elm_Code_Widget *widget) | 479 | _elm_code_widget_fill(Elm_Code_Widget *widget) |
467 | { | 480 | { |
468 | Elm_Code_Widget_Data *pd; | 481 | Elm_Code_Widget_Data *pd; |
@@ -492,10 +505,16 @@ static void | |||
492 | _elm_code_widget_file_cb(void *data, const Efl_Event *event EINA_UNUSED) | 505 | _elm_code_widget_file_cb(void *data, const Efl_Event *event EINA_UNUSED) |
493 | { | 506 | { |
494 | Elm_Code_Widget *widget; | 507 | Elm_Code_Widget *widget; |
508 | Elm_Code_Widget_Data *pd; | ||
495 | 509 | ||
496 | widget = (Elm_Code_Widget *)data; | 510 | widget = (Elm_Code_Widget *)data; |
497 | 511 | ||
498 | _elm_code_widget_fill(widget); | 512 | pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); |
513 | |||
514 | if (elm_code_file_lines_get(pd->code->file)) | ||
515 | _elm_code_widget_fill(widget); | ||
516 | else | ||
517 | _elm_code_widget_clear(widget); | ||
499 | } | 518 | } |
500 | 519 | ||
501 | static void | 520 | static void |