factorize code

This commit is contained in:
Vincent Torri 2022-08-07 11:15:55 +02:00
parent c56a53a933
commit 198267d7ec
3 changed files with 7 additions and 16 deletions

View File

@ -473,10 +473,11 @@ elm_main(int argc, char **argv)
win_w * elm_config_scale_get(),
win_h * elm_config_scale_get());
entice_win_images_set(win, list);
/* once the images are in the list, display the first and current one */
entice_win_image_first_set(win, first);
/*
* store the image list in the Entice struct
* set the first image that will be displayed
*/
entice_win_images_set(win, list, first);
if (fullscreen) elm_win_fullscreen_set(win, EINA_TRUE);

View File

@ -369,7 +369,7 @@ entice_win_title_update(Evas_Object *win)
}
void
entice_win_images_set(Evas_Object *win, Eina_List *images)
entice_win_images_set(Evas_Object *win, Eina_List *images, Eina_List *first)
{
Entice *entice;
@ -378,14 +378,6 @@ entice_win_images_set(Evas_Object *win, Eina_List *images)
entice = evas_object_data_get(win, "entice");
entice->images = images;
}
void
entice_win_image_first_set(Evas_Object *win, Eina_List *first)
{
Entice *entice;
entice = evas_object_data_get(win, "entice");
entice_image_file_set(entice->image, first);
}

View File

@ -100,9 +100,7 @@ Evas_Object *entice_win_add(void);
void entice_win_title_update(Evas_Object *win);
void entice_win_images_set(Evas_Object *win, Eina_List *images);
void entice_win_image_first_set(Evas_Object *win, Eina_List *first);
void entice_win_images_set(Evas_Object *win, Eina_List *images, Eina_List *first);
void entice_win_fullscreen_toggle(Evas_Object *win);