summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-02-07 14:19:05 +0000
committerTom Hacohen <tom@stosb.com>2014-02-07 14:21:26 +0000
commit211845c8851dc48b54824082a63ead6aa98363b9 (patch)
tree4fd61cf8bd0eb962e0efe81745fe5e5a69db53a6 /src
parentc061e7692793740cc363478586e4e062a6b2d7a4 (diff)
Edje entry: Enable allow_set for DEFAULT select mode.
We need to be able to disable selection even when the mode is default. A good use case is thumb scrolling on a desktop.
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_entry.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 01c64c7bb2..5e0ac8458d 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -2224,24 +2224,26 @@ _edje_part_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
2224 } 2224 }
2225 } 2225 }
2226 } 2226 }
2227 if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) 2227 if (en->select_allow)
2228 { 2228 {
2229 if (en->select_allow) 2229 if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT)
2230 { 2230 {
2231 if (en->had_sel) 2231 if (en->had_sel)
2232 { 2232 {
2233 if (en->select_mod_end) 2233 if (en->select_mod_end)
2234 _sel_extend(en->ed, en->cursor, rp->object, en); 2234 _sel_extend(en->ed, en->cursor, rp->object, en);
2235 else if (en->select_mod_start) 2235 else if (en->select_mod_start)
2236 _sel_preextend(en->ed, en->cursor, rp->object, en); 2236 _sel_preextend(en->ed, en->cursor, rp->object, en);
2237 } 2237 }
2238 else 2238 else
2239 _sel_extend(en->ed, en->cursor, rp->object, en); 2239 _sel_extend(en->ed, en->cursor, rp->object, en);
2240 //evas_textblock_cursor_copy(en->cursor, en->sel_end); 2240 //evas_textblock_cursor_copy(en->cursor, en->sel_end);
2241 } 2241 }
2242 else
2243 {
2244 evas_textblock_cursor_copy(en->cursor, en->sel_end);
2245 }
2242 } 2246 }
2243 else
2244 evas_textblock_cursor_copy(en->cursor, en->sel_end);
2245 if (en->selecting) 2247 if (en->selecting)
2246 { 2248 {
2247 if (en->have_selection) 2249 if (en->have_selection)
@@ -2323,27 +2325,25 @@ _edje_part_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
2323 _curs_lin_end(en->cursor, rp->object, en); 2325 _curs_lin_end(en->cursor, rp->object, en);
2324 } 2326 }
2325 } 2327 }
2326 if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT) 2328 if (en->select_allow)
2327 { 2329 {
2328 if (en->select_allow) 2330 if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT)
2329 { 2331 {
2330 if (en->had_sel) 2332 if (en->had_sel)
2331 { 2333 {
2332 if (en->select_mod_end) 2334 if (en->select_mod_end)
2333 _sel_extend(en->ed, en->cursor, rp->object, en); 2335 _sel_extend(en->ed, en->cursor, rp->object, en);
2334 else if (en->select_mod_start) 2336 else if (en->select_mod_start)
2335 _sel_preextend(en->ed, en->cursor, rp->object, en); 2337 _sel_preextend(en->ed, en->cursor, rp->object, en);
2336 } 2338 }
2337 else 2339 else
2338 _sel_extend(en->ed, en->cursor, rp->object, en); 2340 _sel_extend(en->ed, en->cursor, rp->object, en);
2339 } 2341 }
2340 } 2342 else
2341 else 2343 {
2342 { 2344 _sel_extend(en->ed, en->cursor, rp->object, en);
2343 _sel_extend(en->ed, en->cursor, rp->object, en); 2345 }
2344 } 2346
2345 if (en->select_allow)
2346 {
2347 if (evas_textblock_cursor_compare(en->sel_start, en->sel_end) != 0) 2347 if (evas_textblock_cursor_compare(en->sel_start, en->sel_end) != 0)
2348 _sel_enable(en->ed, en->cursor, rp->object, en); 2348 _sel_enable(en->ed, en->cursor, rp->object, en);
2349 if (en->have_selection) 2349 if (en->have_selection)
@@ -3026,8 +3026,7 @@ _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow)
3026 (!rp->typedata.text)) return; 3026 (!rp->typedata.text)) return;
3027 en = rp->typedata.text->entry_data; 3027 en = rp->typedata.text->entry_data;
3028 if (!en) return; 3028 if (!en) return;
3029 if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT) 3029
3030 return;
3031 en->select_allow = allow; 3030 en->select_allow = allow;
3032} 3031}
3033 3032