summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAl Poole <netstar@gmail.com>2017-11-09 00:38:51 +0000
committerAl Poole <netstar@gmail.com>2017-11-09 00:55:36 +0000
commite63e2d7e21df13520cca1b05437e556b3fd6624f (patch)
tree9d027e29ae59ba34ba50a292210db9cb88744e9a /src
parentc2fe37a46dfacdf7f03477ecfe55722f93d93719 (diff)
elm_code_widget: keep track of visibility.
Keep track of visibility and ensure the cursor can never be filled when hidden. This should finally end any issue with the cursor and visibility with the new focus system. Didn't see this previously until working on Edi's bottom panes which caused redraw on resize of the widgets. @fix
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/elm_code_widget.c4
-rw-r--r--src/lib/elementary/elm_code_widget_private.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index 1ce0ffa99c..fc20eac6ec 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -270,7 +270,7 @@ _elm_code_widget_fill_cursor(Elm_Code_Widget *widget, unsigned int number, int g
270 270
271 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); 271 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
272 272
273 if (pd->editable && pd->focussed && pd->cursor_line == number) 273 if (pd->visible && pd->editable && pd->focussed && pd->cursor_line == number)
274 { 274 {
275 if (pd->cursor_col + gutter - 1 >= (unsigned int) w) 275 if (pd->cursor_col + gutter - 1 >= (unsigned int) w)
276 return; 276 return;
@@ -564,6 +564,7 @@ _elm_code_widget_show_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
564 564
565 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); 565 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
566 566
567 pd->visible = EINA_TRUE;
567 if (pd->cursor_rect) 568 if (pd->cursor_rect)
568 evas_object_show(pd->cursor_rect); 569 evas_object_show(pd->cursor_rect);
569} 570}
@@ -577,6 +578,7 @@ _elm_code_widget_hidden_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EIN
577 578
578 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); 579 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
579 580
581 pd->visible = EINA_FALSE;
580 if (pd->cursor_rect) 582 if (pd->cursor_rect)
581 evas_object_hide(pd->cursor_rect); 583 evas_object_hide(pd->cursor_rect);
582} 584}
diff --git a/src/lib/elementary/elm_code_widget_private.h b/src/lib/elementary/elm_code_widget_private.h
index d9e071c246..4e050a799b 100644
--- a/src/lib/elementary/elm_code_widget_private.h
+++ b/src/lib/elementary/elm_code_widget_private.h
@@ -24,7 +24,7 @@ typedef struct
24 unsigned int cursor_line, cursor_col; 24 unsigned int cursor_line, cursor_col;
25 Evas_Object *cursor_rect; 25 Evas_Object *cursor_rect;
26 26
27 Eina_Bool editable, focussed; 27 Eina_Bool visible, editable, focussed;
28 Eina_Bool show_line_numbers; 28 Eina_Bool show_line_numbers;
29 unsigned int line_width_marker, tabstop; 29 unsigned int line_width_marker, tabstop;
30 Eina_Bool show_whitespace, tab_inserts_spaces; 30 Eina_Bool show_whitespace, tab_inserts_spaces;