mothra: dont make all images into links (only in mothmode)
This commit is contained in:
parent
03f2668d68
commit
2b7330765a
|
@ -718,17 +718,19 @@ void dolink(Panel *p, int buttons, Rtext *word){
|
||||||
Action *a;
|
Action *a;
|
||||||
|
|
||||||
a=word->user;
|
a=word->user;
|
||||||
if(a == nil || a->image == nil && a->link == nil)
|
if(a == nil || (a->link == nil && a->image == nil))
|
||||||
return;
|
return;
|
||||||
if(mothmode)
|
if(mothmode)
|
||||||
hiturl(buttons, a->image ? a->image : a->link, 0);
|
hiturl(buttons, a->image ? a->image : a->link, 0);
|
||||||
else if(a->ismap){
|
else if(a->link){
|
||||||
yoffs=plgetpostextview(p);
|
if(a->ismap){
|
||||||
coord=subpt(subpt(mouse.xy, word->r.min), p->r.min);
|
yoffs=plgetpostextview(p);
|
||||||
snprint(mapurl, sizeof(mapurl), "%s?%d,%d", a->link, coord.x, coord.y+yoffs);
|
coord=subpt(subpt(mouse.xy, word->r.min), p->r.min);
|
||||||
hiturl(buttons, mapurl, 1);
|
snprint(mapurl, sizeof(mapurl), "%s?%d,%d", a->link, coord.x, coord.y+yoffs);
|
||||||
} else
|
hiturl(buttons, mapurl, 1);
|
||||||
hiturl(buttons, a->link ? a->link : a->image, 0);
|
} else
|
||||||
|
hiturl(buttons, a->link, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void filter(char *cmd, int fd){
|
void filter(char *cmd, int fd){
|
||||||
|
@ -982,8 +984,15 @@ mothon(Www *w, int on)
|
||||||
*/
|
*/
|
||||||
for(t=w->text;t;t=t->next){
|
for(t=w->text;t;t=t->next){
|
||||||
a=t->user;
|
a=t->user;
|
||||||
if(a == nil || a->image == nil || a->link == nil)
|
if(a == nil || a->image == nil)
|
||||||
continue;
|
continue;
|
||||||
|
if(a->link == nil){
|
||||||
|
if(on)
|
||||||
|
t->flags |= PL_HOT;
|
||||||
|
else
|
||||||
|
t->flags &= ~PL_HOT;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
x = t->next;
|
x = t->next;
|
||||||
if(on){
|
if(on){
|
||||||
t->next = nil;
|
t->next = nil;
|
||||||
|
|
|
@ -144,7 +144,7 @@ void pl_htmloutput(Hglob *g, int nsp, char *s, Field *field){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
plrtstr(&g->dst->text, space, indent, f->font, strdup(s),
|
plrtstr(&g->dst->text, space, indent, f->font, strdup(s),
|
||||||
(g->state->link[0] || g->state->image[0]) ? PL_HOT : 0, ap);
|
g->state->link[0] ? PL_HOT : 0, ap);
|
||||||
g->para=0;
|
g->para=0;
|
||||||
g->linebrk=0;
|
g->linebrk=0;
|
||||||
g->dst->changed=1;
|
g->dst->changed=1;
|
||||||
|
|
Loading…
Reference in a new issue