Compare commits

...

1 Commits

Author SHA1 Message Date
Marcel Hollerbach b091ab559e mixer: lock up the slider for the case a drag is in progress 6 years ago
  1. 12
      src/modules/mixer/e_mod_main.c

@ -127,7 +127,8 @@ static void
_mixer_popup_update(Instance *inst, int mute, int vol)
{
elm_check_state_set(inst->check, !!mute);
elm_slider_value_set(inst->slider, vol);
if (!evas_object_data_del(inst->slider, "__lock"))
elm_slider_value_set(inst->slider, vol);
}
static void _popup_del(Instance *inst);
@ -399,6 +400,14 @@ _slider_drag_stop_cb(void *data EINA_UNUSED, Evas_Object *obj,
Emix_Sink *s = (Emix_Sink *)mixer_context->sink_default;
int val = s->volume.volumes[0];
elm_slider_value_set(obj, val);
evas_object_data_del(obj, "__lock");
}
static void
_slider_drag_start_cb(void *data EINA_UNUSED, Evas_Object *obj,
void *event EINA_UNUSED)
{
evas_object_data_set(obj, "__lock", (void*)1);
}
static void
@ -466,6 +475,7 @@ _popup_new(Instance *inst)
elm_slider_min_max_set(slider, 0.0, emix_max_volume_get());
evas_object_smart_callback_add(slider, "changed", _slider_changed_cb, NULL);
evas_object_smart_callback_add(slider, "slider,drag,stop", _slider_drag_stop_cb, NULL);
evas_object_smart_callback_add(slider, "slider,drag,start", _slider_drag_start_cb, NULL);
elm_slider_value_set(slider, volume);
elm_box_pack_end(bx, slider);
evas_object_show(slider);

Loading…
Cancel
Save