summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Poole <netstar@gmail.com>2017-11-09 00:38:51 +0000
committerAndy Williams <andy@andywilliams.me>2018-02-10 21:53:22 +0000
commit9db0d1f949ae7757f1c086e1d8ec2593afd2c78e (patch)
treefdf6d6bc92c68d849486ba0e654cd938b03c34d3
parentc93ee448c2fad2dadef51ed6ffb98759d1a1d974 (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
-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 954b2f99a7..8880c2fc69 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -271,7 +271,7 @@ _elm_code_widget_fill_cursor(Elm_Code_Widget *widget, unsigned int number, int g
271 271
272 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); 272 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
273 273
274 if (pd->editable && pd->focussed && pd->cursor_line == number) 274 if (pd->visible && pd->editable && pd->focussed && pd->cursor_line == number)
275 { 275 {
276 if (pd->cursor_col + gutter - 1 >= (unsigned int) w) 276 if (pd->cursor_col + gutter - 1 >= (unsigned int) w)
277 return; 277 return;
@@ -617,6 +617,7 @@ _elm_code_widget_show_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
617 617
618 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); 618 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
619 619
620 pd->visible = EINA_TRUE;
620 if (pd->cursor_rect) 621 if (pd->cursor_rect)
621 evas_object_show(pd->cursor_rect); 622 evas_object_show(pd->cursor_rect);
622} 623}
@@ -630,6 +631,7 @@ _elm_code_widget_hidden_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EIN
630 631
631 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); 632 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
632 633
634 pd->visible = EINA_FALSE;
633 if (pd->cursor_rect) 635 if (pd->cursor_rect)
634 evas_object_hide(pd->cursor_rect); 636 evas_object_hide(pd->cursor_rect);
635} 637}
diff --git a/src/lib/elementary/elm_code_widget_private.h b/src/lib/elementary/elm_code_widget_private.h
index ebedec3ad7..bef2b088b3 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;