Commit c93ee448 authored by Al Poole's avatar Al Poole Committed by Andy Williams

elm_code: hide cursor if we hide the widget.

The cursor isn't clipped so if we decide to hide the widget
this ensures the cursor also is hidden. This should not affect
any existing application using elm_code API.
parent 80327232
......@@ -608,6 +608,32 @@ _elm_code_widget_update_focus_directions(Elm_Code_Widget *obj)
elm_widget_focus_next_object_set(obj, obj, ELM_FOCUS_NEXT);
}
static void
_elm_code_widget_show_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Elm_Code_Widget_Data *pd;
Elm_Code_Widget *widget = (Elm_Code_Widget *) data;
pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
if (pd->cursor_rect)
evas_object_show(pd->cursor_rect);
}
static void
_elm_code_widget_hidden_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Elm_Code_Widget_Data *pd;
Elm_Code_Widget *widget = (Elm_Code_Widget *) data;
pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
if (pd->cursor_rect)
evas_object_hide(pd->cursor_rect);
}
static void
_elm_code_widget_cursor_ensure_visible(Elm_Code_Widget *widget)
{
......@@ -2254,6 +2280,8 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _elm_code_widget_resize_cb, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _elm_code_widget_key_down_cb, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_code_widget_hidden_cb, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_code_widget_show_cb, obj);
evas_object_smart_callback_add(obj, "focused", _elm_code_widget_focused_event_cb, obj);
evas_object_smart_callback_add(obj, "unfocused", _elm_code_widget_unfocused_event_cb, obj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment