elm - make progress test code a little more solid and nice to read
use sizeof the buffer rather than constant in snprint and 0.5 rather than .50 which almost looks like a typo... :) also use correct escape for % (%%%% so it becoems %% which is correct for a fmt string yto produce %)
This commit is contained in:
parent
712daf38db
commit
dc8da37878
|
@ -164,7 +164,7 @@ test_progressbar(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
|
|||
elm_box_pack_end(bx, hbx);
|
||||
evas_object_show(hbx);
|
||||
|
||||
snprintf(form, 20, "%d percent (%d %%)", 50, 50);
|
||||
snprintf(form, sizeof(form), "%d percent (%d%%%%)", 50, 50);
|
||||
|
||||
pb = elm_progressbar_add(win);
|
||||
elm_progressbar_horizontal_set(pb, EINA_FALSE);
|
||||
|
@ -172,7 +172,7 @@ test_progressbar(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
|
|||
evas_object_size_hint_align_set(pb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(hbx, pb);
|
||||
elm_progressbar_unit_format_set(pb, form);
|
||||
elm_progressbar_value_set(pb, .50);
|
||||
elm_progressbar_value_set(pb, 0.5);
|
||||
elm_object_text_set(pb, "percent");
|
||||
evas_object_show(pb);
|
||||
pd->pb4 = pb;
|
||||
|
|
Loading…
Reference in New Issue