예제 #1
0
void
textredraw(Text *t, Rectangle r, Font *f, Image *b, int odx)
{
	int maxt;
	Rectangle rr;

	frinit(t, r, f, b, t->Frame.cols);
	rr = t->r;
	rr.min.x -= Scrollwid+Scrollgap;	/* back fill to scroll bar */
	draw(t->b, rr, t->cols[BACK], nil, ZP);
	/* use no wider than 3-space tabs in a directory */
	maxt = maxtab;
	if(t->what == Body){
		if(t->w->isdir)
			maxt = min(TABDIR, maxtab);
		else
			maxt = t->tabstop;
	}
	t->maxtab = maxt*stringwidth(f, "0");
	if(t->what==Body && t->w->isdir && odx!=Dx(t->all)){
		if(t->maxlines > 0){
			textreset(t);
			textcolumnate(t, t->w->dlp,  t->w->ndl);
			textshow(t, 0, 0, 1);
		}
	}else{
		textfill(t);
		textsetselect(t, t->q0, t->q1);
	}
}
예제 #2
0
파일: cmdw.c 프로젝트: grobe0ba/plan9front
static void
cmddraw(Win *w)
{
	Rectangle r;
	
	frclear(&w->fr, 0);
	r = insetrect(w->inner, 1);
	r.min.x += SCRTSIZ;
	scrollbar(w);
	frinit(&w->fr, r, display->defaultfont, w->im, w->tab->cols);
	frinsert(&w->fr, w->runes + w->toprune, w->runes + w->nrunes, 0);
}
예제 #3
0
파일: text.c 프로젝트: AustenConrad/plan-9
void
textredraw(Text *t, Rectangle r, Font *f, Image *b)
{
	Rectangle r1;

	frinit(t, r, f, b, t->Frame.cols);
	r1 = t->r;
	r1.min.x -= Scrollsize+Scrollgap;	/* back fill to scroll bar */
	draw(t->b, r1, t->cols[BACK], nil, ZP);
	t->maxtab = Maxtab*stringwidth(f, "0");
	textfill(t);
	textsetselect(t, t->q0, t->q1);
}