page: nested browsing

This commit is contained in:
cinap_lenrek 2011-10-18 10:02:06 +02:00
parent fe3de08658
commit e2ed2a0b7e

View file

@ -721,13 +721,12 @@ popenfile(Page *p)
Page* Page*
nextpage(Page *p) nextpage(Page *p)
{ {
if(p){ if(p && p->down)
if(p->down) return p->down;
return p->down; while(p){
if(p->next) if(p->next)
return p->next; return p->next;
if(p->up) p = p->up;
return p->up->next;
} }
return nil; return nil;
} }
@ -1336,13 +1335,16 @@ main(int argc, char *argv[])
continue; continue;
} }
if(m.buttons & 4){ if(m.buttons & 4){
Page *x;
if(root->down == nil) if(root->down == nil)
goto Unlock; goto Unlock;
qlock(&pagelock);
pagemenu.lasthit = pageindex(current); pagemenu.lasthit = pageindex(current);
i = emenuhit(3, &m, &pagemenu); x = pageat(emenuhit(3, &m, &pagemenu));
qunlock(&pagelock);
unlockdisplay(display); unlockdisplay(display);
if(i != -1) showpage(x);
showpage(pageat(i));
continue; continue;
} }
Unlock: Unlock: