Commit 899d2df8 authored by Ludovic Fauvet's avatar Ludovic Fauvet

volume gesture: add a visual representation of the volume in %

parent 648f81cc
......@@ -67,6 +67,27 @@ collections
}
}
}
part{
name: "text_overlay";
type: TEXT;
description{
min: 50 50;
state: "default" 0.0;
color: 255 136 0 255; /* orange */
visible: 1;
rel1{
relative: 0.0 0.0;
}
rel2{
relative: 1.0 0.2;
}
text {
align: 0.5 0.5;
size: 25;
//text: "Volume: 30%";
}
}
}
part{
name: "hub_background";
type: RECT;
......
......@@ -495,6 +495,11 @@ line_move(void *data, void *event_info)
sound_manager_set_volume(SOUND_TYPE_MEDIA, volume);
LOGD("Volume: %d (max %d)", volume, max);
char *tmp;
asprintf(&tmp, "Volume: %d%%", (volume * 100) / max);
elm_object_part_text_set(p_sys->layout, "text_overlay", tmp);
free(tmp);
}
return EVAS_EVENT_FLAG_ON_HOLD;
......@@ -511,6 +516,7 @@ line_end(void *data, void *event_info)
view_sys *p_sys = data;
p_sys->gesture_volume = false;
elm_object_part_text_set(p_sys->layout, "text_overlay", "");
return EVAS_EVENT_FLAG_ON_HOLD;
}
......@@ -521,6 +527,7 @@ line_abort(void *data, void *event_info)
LOGD("line abort");
p_sys->gesture_volume = false;
elm_object_part_text_set(p_sys->layout, "text_overlay", "");
return EVAS_EVENT_FLAG_ON_HOLD;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment