viking

webkit based web browser for Enlightenment
Log | Files | Refs | LICENSE

commit d022232ca453f8a3546a41f77da184c796c9750f
parent 80ff66050884b6d75d436330efac1918f2c21f93
Author: Kyle Milz <kmilz@ucalgary.ca>
Date:   Mon, 12 Nov 2012 15:52:49 -0700

buffer: add more robust implementation for favicons

Diffstat:
Msrc/utilities.c | 31+++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/src/utilities.c b/src/utilities.c @@ -535,19 +535,26 @@ make_buffer_number(Evas_Object *label, Buffer_Data *bd) static void received_favicon_cb(const char *url, Evas_Object *icon, void *data) { + Evas_Object *old_icon; + Eina_List *l; Evas_Object *row = data; - if (icon == NULL) - return; - - evas_object_ref(icon); - - evas_object_size_hint_align_set(icon, 0.0, EVAS_HINT_FILL); - evas_object_size_hint_max_set(icon, 16, 16); - evas_object_size_hint_min_set(icon, 16, 16); + EINA_LIST_FOREACH(elm_box_children_get(row), l, old_icon) { + evas_object_unref(old_icon); + evas_object_del(old_icon); + } - elm_box_pack_end(row, icon); - evas_object_show(icon); + if (icon) { + /* Workaround for icon display bug: + * http://trac.enlightenment.org/e/ticket/1616 */ + evas_object_size_hint_min_set(icon, 16, 16); + evas_object_image_filled_set(icon, EINA_FALSE); + evas_object_image_fill_set(icon, 16, 0, 16, 16); + // elm_object_part_content_set(app_data->url_bar, "icon", icon); + elm_box_pack_end(row, icon); + evas_object_ref(icon); + evas_object_show(icon); + } } void @@ -555,10 +562,10 @@ make_favicon(Evas_Object *icon, Buffer_Data *bd) { Ewk_Favicon_Database *database; Window_Data *wd = bd->window; - Evas *e = evas_object_evas_get(wd->win); + Evas *e = evas_object_evas_get(bd->view); const char *url = ewk_view_url_get(bd->view); - elm_box_clear(icon); + // elm_box_clear(icon); database = ewk_context_favicon_database_get(ewk_context_default_get()); ewk_favicon_database_async_icon_get( database,