aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/gravatar.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2014-10-09 21:45:01 +0200
committerBoris Faure <billiob@gmail.com>2014-10-15 21:44:59 +0200
commit58de591e5812d465ed235409ce44ab751a390be0 (patch)
tree755c454a4ce49e981f9ea4f49758ff5938ad8ff9 /src/bin/gravatar.c
parentset media type as an enum (diff)
downloadterminology-58de591e5812d465ed235409ce44ab751a390be0.tar.gz
show gravatar tooltips on emails
Diffstat (limited to 'src/bin/gravatar.c')
-rw-r--r--src/bin/gravatar.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/bin/gravatar.c b/src/bin/gravatar.c
index 5f2e8a5..1ac8f0b 100644
--- a/src/bin/gravatar.c
+++ b/src/bin/gravatar.c
@@ -38,15 +38,10 @@ _tooltip_content(void *data,
{
Gravatar *g = data;
Evas_Object *o;
- int type;
- //o = elm_label_add(obj);
- //elm_object_text_set(o, url);
- DBG("url:%s", g->url);
- /* TODO */
- o = media_add(obj, g->url, g->config, MEDIA_TOOLTIP, &type);
+ o = media_add(obj, g->url, g->config, MEDIA_STRETCH, MEDIA_TYPE_IMG);
+ evas_object_size_hint_min_set(o, 80, 80);
- /* TODO: handle Gravatar leak */
return o;
}
@@ -56,7 +51,6 @@ _tooltip_del(void *data,
void *event_info EINA_UNUSED)
{
Gravatar *g = data;
- DBG("url:%s", g->url);
eina_stringshare_del(g->url);
free(g);
}
@@ -76,9 +70,7 @@ gravatar_tooltip(Evas_Object *obj, Config *config, char *email)
if (!g) return;
g->config = config;
- DBG("need to show tooltip for email:%s", email);
eina_str_tolower(&email);
- DBG("lower:%s", email);
MD5Init(&ctx);
MD5Update(&ctx, (unsigned char const*)email, (unsigned)strlen(email));
@@ -91,13 +83,9 @@ gravatar_tooltip(Evas_Object *obj, Config *config, char *email)
}
md5out[2 * MD5_HASHBYTES] = '\0';
- DBG("md5:%s", md5out);
-
url = eina_stringshare_printf(GRAVATAR_URL_START"%s"GRAVATAR_URL_END,
md5out);
- DBG("url:%s", url);
-
g->url = url;
elm_object_tooltip_content_cb_set(obj, _tooltip_content,
g,