summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-09-29 13:56:16 +0200
committerBoris Faure <billiob@gmail.com>2019-09-29 13:56:16 +0200
commit9f156eb94842b6518ee15606de653539f46cffbb (patch)
tree62d5faa1ef6108171031889591dc13d9b7372d72 /src
parentc11f7e4c19287e6de64061fe4d58d88c38c4a6b5 (diff)
parent61bb7955dafc82a28f9c90e13bf1d8c3c746f32c (diff)
Merge branch 'terminology-1.5'
Diffstat (limited to 'src')
-rw-r--r--src/bin/sel.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/bin/sel.c b/src/bin/sel.c
index 8c56199..46a0470 100644
--- a/src/bin/sel.c
+++ b/src/bin/sel.c
@@ -86,6 +86,7 @@ _mouse_up_cb(void *data,
86 Evas_Event_Mouse_Up *ev = event; 86 Evas_Event_Mouse_Up *ev = event;
87 Sel *sd = data; 87 Sel *sd = data;
88 Evas_Coord dx, dy; 88 Evas_Coord dx, dy;
89 Evas_Coord finger_size;
89 90
90 EINA_SAFETY_ON_NULL_RETURN(sd); 91 EINA_SAFETY_ON_NULL_RETURN(sd);
91 92
@@ -96,8 +97,9 @@ _mouse_up_cb(void *data,
96 sd->down.down = EINA_FALSE; 97 sd->down.down = EINA_FALSE;
97 dx = abs(ev->canvas.x - sd->down.x); 98 dx = abs(ev->canvas.x - sd->down.x);
98 dy = abs(ev->canvas.y - sd->down.y); 99 dy = abs(ev->canvas.y - sd->down.y);
99 if ((dx <= elm_config_finger_size_get()) && 100 finger_size = elm_config_finger_size_get();
100 (dy <= elm_config_finger_size_get())) 101 if ((dx <= finger_size) &&
102 (dy <= finger_size))
101 { 103 {
102 Eina_List *l; 104 Eina_List *l;
103 Entry *en; 105 Entry *en;
@@ -110,7 +112,7 @@ _mouse_up_cb(void *data,
110 evas_object_geometry_get(en->bg, &ox, &oy, &ow, &oh); 112 evas_object_geometry_get(en->bg, &ox, &oy, &ow, &oh);
111 if (ELM_RECTS_INTERSECT(ox, oy, ow, oh, x, y, 1, 1)) 113 if (ELM_RECTS_INTERSECT(ox, oy, ow, oh, x, y, 1, 1))
112 { 114 {
113 sel_entry_selected_set(data, en->obj, EINA_FALSE); 115 sel_entry_selected_set(sd->self, en->obj, EINA_FALSE);
114 sd->select_me = EINA_TRUE; 116 sd->select_me = EINA_TRUE;
115 sd->exit_me = EINA_FALSE; 117 sd->exit_me = EINA_FALSE;
116 if (sd->autozoom_timeout) 118 if (sd->autozoom_timeout)
@@ -792,33 +794,37 @@ sel_entry_selected_set(Evas_Object *obj, Evas_Object *entry, Eina_Bool keep_befo
792 config = sd->config; 794 config = sd->config;
793 if (!config) return; 795 if (!config) return;
794 796
797 /* Unselect previous selected item */
798 EINA_LIST_FOREACH(sd->items, l, en)
799 {
800 if ( (en->obj != entry) && (en->selected) )
801 {
802 if ((sd->w > 0) && (sd->h > 0))
803 edje_object_signal_emit(en->bg, "unselected", "terminology");
804 else
805 {
806 en->was_selected = EINA_TRUE;
807 sd->pending_sel = EINA_TRUE;
808 }
809 en->selected = EINA_FALSE;
810 sd->select_me = EINA_FALSE;
811 sd->exit_me = EINA_FALSE;
812 }
813 if (!keep_before) en->selected_before = EINA_FALSE;
814 }
815 /* Select new item */
795 EINA_LIST_FOREACH(sd->items, l, en) 816 EINA_LIST_FOREACH(sd->items, l, en)
796 { 817 {
797 if (en->obj == entry) 818 if (en->obj == entry)
798 { 819 {
820 en->was_selected = EINA_FALSE;
821 en->selected = EINA_TRUE;
799 if ((sd->w > 0) && (sd->h > 0)) 822 if ((sd->w > 0) && (sd->h > 0))
800 edje_object_signal_emit(en->bg, "selected", "terminology"); 823 edje_object_signal_emit(en->bg, "selected", "terminology");
801 else 824 else
802 sd->pending_sel = EINA_TRUE; 825 sd->pending_sel = EINA_TRUE;
803 evas_object_stack_below(en->bg, sd->o_event); 826 evas_object_stack_below(en->bg, sd->o_event);
804 en->was_selected = EINA_FALSE;
805 en->selected = EINA_TRUE;
806 }
807 else
808 {
809 if (en->selected)
810 {
811 if ((sd->w > 0) && (sd->h > 0))
812 edje_object_signal_emit(en->bg, "unselected", "terminology");
813 else
814 {
815 en->was_selected = EINA_TRUE;
816 sd->pending_sel = EINA_TRUE;
817 }
818 en->selected = EINA_FALSE;
819 }
820 } 827 }
821 if (!keep_before) en->selected_before = EINA_FALSE;
822 } 828 }
823 sd->use_px = EINA_FALSE; 829 sd->use_px = EINA_FALSE;
824 _transit(sd, config->tab_zoom); 830 _transit(sd, config->tab_zoom);