Tidying up
This commit is contained in:
parent
6fd8b24a06
commit
3e42056b88
8
src/ui.c
8
src/ui.c
|
@ -140,11 +140,10 @@ _misc_view_update(Ui *ui, results_t *results)
|
||||||
|
|
||||||
char buf[256];
|
char buf[256];
|
||||||
snprintf(buf, sizeof(buf), "Battery %d ", i);
|
snprintf(buf, sizeof(buf), "Battery %d ", i);
|
||||||
if (results->power.have_ac)
|
if (results->power.have_ac && i == 0)
|
||||||
strcat(buf, "(plugged in)");
|
strcat(buf, "(plugged in)");
|
||||||
|
|
||||||
elm_object_text_set(frame, buf);
|
elm_object_text_set(frame, buf);
|
||||||
|
|
||||||
evas_object_show(frame);
|
evas_object_show(frame);
|
||||||
|
|
||||||
progress = elm_progressbar_add(frame);
|
progress = elm_progressbar_add(frame);
|
||||||
|
@ -156,8 +155,13 @@ _misc_view_update(Ui *ui, results_t *results)
|
||||||
evas_object_show(progress);
|
evas_object_show(progress);
|
||||||
elm_object_content_set(frame, progress);
|
elm_object_content_set(frame, progress);
|
||||||
elm_box_pack_end(box, frame);
|
elm_box_pack_end(box, frame);
|
||||||
|
|
||||||
|
free(results->power.batteries[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (results->power.batteries)
|
||||||
|
free(results->power.batteries);
|
||||||
|
|
||||||
frame = elm_frame_add(box);
|
frame = elm_frame_add(box);
|
||||||
evas_object_size_hint_align_set(frame, EVAS_HINT_FILL, 0);
|
evas_object_size_hint_align_set(frame, EVAS_HINT_FILL, 0);
|
||||||
evas_object_size_hint_weight_set(frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
|
Loading…
Reference in New Issue