From 98fad6cec28e019aedc587cccf3cad68a5a842f3 Mon Sep 17 00:00:00 2001 From: moom Date: Sun, 20 Aug 2006 09:48:13 +0000 Subject: [PATCH] * [Entry] Fix the blinking of the cursor * [Entry] Support Copy/Cut. Paste will come later SVN revision: 24933 --- data/themes/default_entry.edc | 15 ++++++++++++--- src/bin/e_editable.c | 21 +++++++++++++++++---- src/bin/e_entry.c | 6 +++++- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/data/themes/default_entry.edc b/data/themes/default_entry.edc index 967d0f89f..8759f074a 100644 --- a/data/themes/default_entry.edc +++ b/data/themes/default_entry.edc @@ -120,9 +120,18 @@ group { } programs { program { - name: "cursor_show"; - signal: "show"; + name: "on_cursor_show"; + signal: "cursor_show"; source: ""; + action: ACTION_STOP; + target: "cursor_show"; + target: "cursor_hide"; + target: "cursor_show_timer"; + target: "cursor_hide_timer"; + after: "cursor_show"; + } + program { + name: "cursor_show"; action: STATE_SET "visible" 0.0; target: "cursor"; after: "cursor_show_timer"; @@ -135,7 +144,7 @@ group { } program { name: "cursor_show_timer"; - in: 1.25 0.0; + in: 1.0 0.0; after: "cursor_hide"; } program { diff --git a/src/bin/e_editable.c b/src/bin/e_editable.c index 8f8fe171d..0ec6d821f 100644 --- a/src/bin/e_editable.c +++ b/src/bin/e_editable.c @@ -485,7 +485,11 @@ e_editable_cursor_show(Evas_Object *editable) return; sd->cursor_visible = 1; - evas_object_show(sd->cursor_object); + if (evas_object_visible_get(editable)) + { + evas_object_show(sd->cursor_object); + edje_object_signal_emit(sd->cursor_object, "cursor_show", ""); + } } /** @@ -922,8 +926,11 @@ _e_editable_cursor_update(Evas_Object *editable) } } - if (sd->cursor_visible) - evas_object_show(sd->cursor_object); + if (sd->cursor_visible && evas_object_visible_get(editable)) + { + evas_object_show(sd->cursor_object); + edje_object_signal_emit(sd->cursor_object, "cursor_show", ""); + } _e_editable_selection_update(editable); _e_editable_text_position_update(editable, -1); @@ -1107,14 +1114,17 @@ _e_editable_smart_add(Evas_Object *object) evas_object_smart_member_add(sd->event_object, object); sd->text_object = edje_object_add(evas); + evas_object_pass_events_set(sd->text_object, 1); evas_object_clip_set(sd->text_object, sd->clip_object); evas_object_smart_member_add(sd->text_object, object); sd->selection_object = edje_object_add(evas); + evas_object_pass_events_set(sd->selection_object, 1); evas_object_clip_set(sd->selection_object, sd->clip_object); evas_object_smart_member_add(sd->selection_object, object); sd->cursor_object = edje_object_add(evas); + evas_object_pass_events_set(sd->cursor_object, 1); evas_object_clip_set(sd->cursor_object, sd->clip_object); evas_object_smart_member_add(sd->cursor_object, object); @@ -1200,7 +1210,10 @@ _e_editable_smart_show(Evas_Object *object) evas_object_show(sd->text_object); if (sd->cursor_visible) - evas_object_show(sd->cursor_object); + { + evas_object_show(sd->cursor_object); + edje_object_signal_emit(sd->cursor_object, "cursor_show", ""); + } if ((sd->selection_visible) && (sd->cursor_pos != sd->selection_pos)) evas_object_show(sd->selection_object); diff --git a/src/bin/e_entry.c b/src/bin/e_entry.c index ef2a57b38..b11edc281 100644 --- a/src/bin/e_entry.c +++ b/src/bin/e_entry.c @@ -283,6 +283,7 @@ _e_entry_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) int selecting; int changed = 0; char *range; + E_Win *win; if ((!obj) || (!(sd = evas_object_smart_data_get(obj)))) return; @@ -379,7 +380,10 @@ _e_entry_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) range = e_editable_text_range_get(editable, start_pos, end_pos); if (range) { - //ecore_x_selection_clipboard_set(); + if ((win = e_win_evas_object_win_get(obj))) + ecore_x_selection_clipboard_set(win->evas_win, + range, + strlen(range) + 1); free(range); } if ((sd->enabled) && (strcmp(event->keyname, "x") == 0))