efl_ui_range_interactive: add a new event

the steady event from slider now moved here. A spec test suite and the
corresponding implementations will follow.

ref T7894

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D9458
This commit is contained in:
Marcel Hollerbach 2019-07-31 14:38:13 +02:00 committed by Cedric BAIL
parent ca813f41a6
commit 010f813572
6 changed files with 13 additions and 11 deletions

View File

@ -72,11 +72,11 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{ std::cout << "Changed to " << obj.range_value_get() << std::endl; }
, std::placeholders::_1);
auto steady = std::bind ( [] (efl::ui::Slider obj)
auto steady = std::bind ( [] (efl::ui::Range_Interactive obj)
{ std::cout << "Steady to " << obj.range_value_get() << std::endl; }
, std::placeholders::_1);
efl::eo::downcast<efl::ui::Range_Display>(sl7).changed_event_cb_add(changed);
sl7.steady_event_cb_add(steady);
efl::eo::downcast<efl::ui::Range_Interactive>(sl7).steady_event_cb_add(steady);
}
EFL_MAIN()

View File

@ -23,4 +23,11 @@ interface @beta Efl.Ui.Range_Interactive extends Efl.Ui.Range_Display
}
}
}
events {
steady: void; [[Called when the widget's value has changed and has remained unchanged for 0.2s.
This allows filtering out unwanted "noise" from the widget if you are only
interested in its final position.
Use this event instead of @[Efl.Ui.Range_Display.changed] if you are going to perform a costly operation
on its handler. ]]
}
}

View File

@ -34,7 +34,7 @@ _delay_change(void *data)
EFL_UI_SLIDER_DATA_GET(data, sd);
sd->delay = NULL;
efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_STEADY, NULL);
efl_event_callback_call(data, EFL_UI_RANGE_EVENT_STEADY, NULL);
if (_elm_config->atspi_mode)
efl_access_value_changed_signal_emit(data);

View File

@ -20,11 +20,6 @@ class @beta Efl.Ui.Slider extends Efl.Ui.Layout_Base implements Efl.Ui.Range_Int
Efl.Access.Widget.Action.elm_actions { get; }
}
events {
steady: void; [[Called when the slider position has changed and has remained unchanged for 0.2s.
This allows filtering out unwanted "noise" from the slider signal if you are only
interested in the final position of the slider.
Use this signal instead of @[Efl.Ui.Range_Display.changed] if you are going to perform a costly operation
on its handler.]]
slider,drag,start: void; [[Called when a slider drag operation has started. This means a $press event
has been received on the slider thumb but not the $unpress.]]
slider,drag,stop: void; [[Called when a slider drag operation has finished. This means an $unpress event

View File

@ -22,7 +22,7 @@ _delay_change(void *data)
EFL_UI_SLIDER_INTERVAL_DATA_GET(data, pd);
pd->delay = NULL;
efl_event_callback_call(data, EFL_UI_SLIDER_EVENT_STEADY, NULL);
efl_event_callback_call(data, EFL_UI_RANGE_EVENT_STEADY, NULL);
if (_elm_config->atspi_mode)
efl_access_value_changed_signal_emit(data);

View File

@ -27,7 +27,7 @@ EFL_START_TEST(efl_ui_test_slider_events)
efl_gfx_entity_size_set(win, EINA_SIZE2D(400, 100));
slider = efl_add(EFL_UI_SLIDER_CLASS, win,
efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED, slider_changed, NULL),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_STEADY, slider_changed, NULL),
efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_STEADY, slider_changed, NULL),
efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(400, 100))
);
@ -61,7 +61,7 @@ EFL_START_TEST(efl_ui_test_slider_step)
efl_gfx_entity_size_set(win, EINA_SIZE2D(400, 100));
slider = efl_add(EFL_UI_SLIDER_CLASS, win,
efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED, slider_changed, NULL),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_STEADY, slider_changed, NULL),
efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_STEADY, slider_changed, NULL),
efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(400, 100))
);
efl_ui_range_limits_set(slider, 0, 100);