summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Poole <netstar@gmail.com>2017-10-21 01:28:06 +0100
committerAl Poole <netstar@gmail.com>2017-10-21 01:28:06 +0100
commiteeb25519b3b56094aa889d99a15dbe17f8f61786 (patch)
tree09acbf646e99fbaadb3106ff079b3151d3989296
parent613649a39fe1481af494f33542c020b0b632183a (diff)
downloadefl-eeb25519b3b56094aa889d99a15dbe17f8f61786.tar.gz
elm_code_widget: make sure the widget is cleared properly.
This ensures the widget is clearer if the file has been cleared. @fix T6185
-rw-r--r--src/lib/elementary/elm_code_widget.c21
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)
}
static void
+_elm_code_widget_clear(Elm_Code_Widget *widget)
+{
+ Elm_Code_Widget_Data *pd;
+ Evas_Object *grid;
+
+ pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
+ EINA_LIST_FREE(pd->grids, grid)
+ {
+ evas_object_del(grid);
+ }
+}
+
+static void
_elm_code_widget_fill(Elm_Code_Widget *widget)
{
Elm_Code_Widget_Data *pd;
@@ -492,10 +505,16 @@ static void
_elm_code_widget_file_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
Elm_Code_Widget *widget;
+ Elm_Code_Widget_Data *pd;
widget = (Elm_Code_Widget *)data;
- _elm_code_widget_fill(widget);
+ pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
+
+ if (elm_code_file_lines_get(pd->code->file))
+ _elm_code_widget_fill(widget);
+ else
+ _elm_code_widget_clear(widget);
}
static void