termio: clean up _update_link()

This commit is contained in:
Boris Faure 2014-10-05 20:59:19 +02:00
parent 564d78ce93
commit 32fb73b733
1 changed files with 75 additions and 76 deletions

View File

@ -1095,6 +1095,11 @@ static void
_update_link(Evas_Object *obj, Termio *sd, _update_link(Evas_Object *obj, Termio *sd,
Eina_Bool same_link, Eina_Bool same_geom) Eina_Bool same_link, Eina_Bool same_geom)
{ {
Evas_Coord ox, oy, ow, oh;
Evas_Object *o;
Eina_Bool popup_exists;
int y;
EINA_SAFETY_ON_NULL_RETURN(sd); EINA_SAFETY_ON_NULL_RETURN(sd);
if (!same_link) if (!same_link)
@ -1102,16 +1107,12 @@ _update_link(Evas_Object *obj, Termio *sd,
// check link and re-probe/fetch create popup preview // check link and re-probe/fetch create popup preview
} }
if (!same_geom) if (same_geom)
{ return;
Evas_Coord ox, oy, ow, oh;
Evas_Object *o;
// fix up edje objects "underlining" the link
int y;
if (sd->link.suspend)
return;
evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
if (!sd->link.suspend)
{
EINA_LIST_FREE(sd->link.objs, o) EINA_LIST_FREE(sd->link.objs, o)
{ {
if (sd->link.down.dndobj == o) if (sd->link.down.dndobj == o)
@ -1122,9 +1123,11 @@ _update_link(Evas_Object *obj, Termio *sd,
else else
evas_object_del(o); evas_object_del(o);
} }
if (sd->link.string) if (!sd->link.string)
{ return;
if ((!main_term_popup_exists(sd->term)) &&
popup_exists = main_term_popup_exists(sd->term);
if ((!popup_exists) &&
((sd->link.string[0] == '/') || (link_is_url(sd->link.string)))) ((sd->link.string[0] == '/') || (link_is_url(sd->link.string))))
{ {
Evas_Coord _x = ox, _y = oy; Evas_Coord _x = ox, _y = oy;
@ -1186,9 +1189,6 @@ _update_link(Evas_Object *obj, Termio *sd,
_cb_link_move, obj); _cb_link_move, obj);
} }
} }
}
}
}
static void static void
_remove_links(Termio *sd, Evas_Object *obj) _remove_links(Termio *sd, Evas_Object *obj)
@ -4032,7 +4032,6 @@ _smart_apply(Evas_Object *obj)
if (ch1 >= 0) if (ch1 >= 0)
evas_object_textgrid_update_add(sd->grid.obj, ch1, y, evas_object_textgrid_update_add(sd->grid.obj, ch1, y,
ch2 - ch1 + 1, 1); ch2 - ch1 + 1, 1);
//printf("I'm fine thanx\n");
} }
termpty_cellcomp_thaw(sd->pty); termpty_cellcomp_thaw(sd->pty);