netstar pushed a commit to branch master. http://git.enlightenment.org/apps/evisum.git/commit/?id=316db18173b778725f32c81e93d315b7280de70f
commit 316db18173b778725f32c81e93d315b7280de70f Author: Alastair Poole <nets...@gmail.com> Date: Fri Sep 11 14:14:53 2020 +0100 ui_util: one image is enough. --- data/images/clo.png | Bin 2264326 -> 2248939 bytes src/bin/ui/ui_util.c | 26 ++++---------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/data/images/clo.png b/data/images/clo.png index dfba7bd..b3346e3 100644 Binary files a/data/images/clo.png and b/data/images/clo.png differ diff --git a/src/bin/ui/ui_util.c b/src/bin/ui/ui_util.c index 2978cb6..0cc2b59 100644 --- a/src/bin/ui/ui_util.c +++ b/src/bin/ui/ui_util.c @@ -493,9 +493,7 @@ typedef struct { Ui *ui; int pos; - int bg_pos; Evas_Object *im; - Evas_Object *bg; Evas_Object *bolt; } Animation; @@ -524,10 +522,6 @@ _anim_clouds(void *data) evas_object_image_fill_set(anim->im, anim->pos, 0, iw, ih); anim->pos += cpu; - evas_object_resize(anim->bg, iw, wh); - evas_object_image_fill_set(anim->bg, anim->bg_pos, 0, iw, ih); - anim->bg_pos++; - t = time(NULL); if (cpu >= 6 && !bolt) @@ -542,10 +536,11 @@ _anim_clouds(void *data) if (bolt) { struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - srand(ts.tv_nsec); + if (bolt++ == 1) { + clock_gettime(CLOCK_REALTIME, &ts); + srand(ts.tv_nsec); evas_object_image_size_get(anim->bolt, &iw, &ih); evas_object_move(anim->bolt, -(rand() % iw), -(rand() % (ih / 4))); } @@ -563,8 +558,6 @@ _anim_clouds(void *data) if (anim->pos >= iw) anim->pos = 0; - if (anim->bg_pos >= iw) - anim->bg_pos = 0; return ECORE_CALLBACK_RENEW; } @@ -574,7 +567,7 @@ evisum_ui_animate(void *data) { Animation *anim; Ui *ui; - Evas_Object *bg, *im; + Evas_Object *im; Evas_Coord iw, ih, ww, wh; ui = data; @@ -586,16 +579,6 @@ evisum_ui_animate(void *data) evas_object_geometry_get(ui->win, NULL, NULL, &ww, &wh); - anim->bg = bg = evas_object_image_add(evas_object_evas_get(ui->win)); - evas_object_image_file_set(bg, evisum_icon_path_get("clo"), NULL); - evas_object_image_size_get(bg, &iw, &ih); - evas_object_image_fill_set(bg, ww / 3, 0, iw, wh); - evas_object_resize(bg, iw, wh); - evas_object_move(bg, 0, 0); - evas_object_color_set(bg, 64, 64, 64, 64); - evas_object_pass_events_set(bg, 1); - evas_object_show(bg); - anim->bolt = im = evas_object_image_filled_add(evas_object_evas_get(ui->win)); evas_object_pass_events_set(im, 1); evas_object_image_file_set(im, evisum_icon_path_get("bolt"), NULL); @@ -609,7 +592,6 @@ evisum_ui_animate(void *data) evas_object_image_fill_set(im, ww / 2, 0, iw, wh); evas_object_resize(im, iw, wh); evas_object_move(im, 0, 0); - evas_object_color_set(im, 192, 192, 192, 192); evas_object_pass_events_set(im, 1); evas_object_show(im); --