summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-16 13:59:40 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-07-16 16:37:29 +0200
commit4b1a1e85b2d77bccdc03ca6ece389aea4881d3ec (patch)
tree4f115455d448d0e298c4a1c739fbc38f82248084 /src
parent059e82d4c1c7a49bae40b83178a9efb7e3be1175 (diff)
efl_ui_slider: fix focus interaction
Summary: when we move the slider up or down, we might be at the minimum or maximu, if this is the case. Then we must not eat the key event, otherwise focus is stuck on this widget. Depends on D9328 Reviewers: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9329
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_slider.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 7deda127db..2714cce3d5 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -220,6 +220,7 @@ _drag_up(void *data,
220 else 220 else
221 efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.dragable.slider"), 221 efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.dragable.slider"),
222 relative_step, relative_step); 222 relative_step, relative_step);
223 _slider_update(data, EINA_TRUE);
223} 224}
224 225
225static void 226static void
@@ -244,6 +245,7 @@ _drag_down(void *data,
244 else 245 else
245 efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.dragable.slider"), 246 efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.dragable.slider"),
246 relative_step, relative_step); 247 relative_step, relative_step);
248 _slider_update(data, EINA_TRUE);
247} 249}
248 250
249static Eina_Bool 251static Eina_Bool
@@ -251,6 +253,9 @@ _key_action_drag(Evas_Object *obj, const char *params)
251{ 253{
252 EFL_UI_SLIDER_DATA_GET(obj, sd); 254 EFL_UI_SLIDER_DATA_GET(obj, sd);
253 const char *dir = params; 255 const char *dir = params;
256 double old_value, new_value;
257
258 old_value = efl_ui_range_value_get(obj);
254 259
255 if (!strcmp(dir, "left")) 260 if (!strcmp(dir, "left"))
256 { 261 {
@@ -286,7 +291,8 @@ _key_action_drag(Evas_Object *obj, const char *params)
286 } 291 }
287 else return EINA_FALSE; 292 else return EINA_FALSE;
288 293
289 return EINA_TRUE; 294 new_value = efl_ui_range_value_get(obj);
295 return !EINA_DBL_EQ(new_value, old_value);
290} 296}
291 297
292// _slider_efl_ui_widget_widget_input_event_handler 298// _slider_efl_ui_widget_widget_input_event_handler