shithub: patch

ref: fd24485a39c844fde8c7754a51991df3ab9fad93
dir: /acme-col/

View raw version
diff -r eafb71d27315 sys/src/cmd/acme/acme.c
--- a/sys/src/cmd/acme/acme.c	Wed Apr 14 20:30:24 2021 -0700
+++ b/sys/src/cmd/acme/acme.c	Fri Apr 16 07:16:49 2021 +0200
@@ -876,18 +876,18 @@
 	Image *tmp;
 
 	/* Blue */
-	tagcols[BACK] = allocimagemix(display, DPalebluegreen, DWhite);
-	tagcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPalegreygreen);
-	tagcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPurpleblue);
-	tagcols[TEXT] = display->black;
-	tagcols[HTEXT] = display->black;
+	tagcols[BACK] = display->black;
+	tagcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x111111FF);
+	tagcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x440000FF);
+	tagcols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x770000FF);
+	tagcols[HTEXT] = tagcols[TEXT];
 
 	/* Yellow */
-	textcols[BACK] = allocimagemix(display, DPaleyellow, DWhite);
-	textcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkyellow);
-	textcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DYellowgreen);
-	textcols[TEXT] = display->black;
-	textcols[HTEXT] = display->black;
+	textcols[BACK] = display->black;
+	textcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x440000FF);
+	textcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x111111FF);
+	textcols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x884400FF);
+	textcols[HTEXT] = textcols[TEXT];
 
 	if(button){
 		freeimage(button);
@@ -907,12 +907,12 @@
 	r.max.x -= 2;
 	border(modbutton, r, 2, tagcols[BORD], ZP);
 	r = insetrect(r, 2);
-	tmp = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DMedblue);
+	tmp = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x884400FF);
 	draw(modbutton, r, tmp, nil, ZP);
 	freeimage(tmp);
 
 	r = button->r;
-	colbutton = allocimage(display, r, screen->chan, 0, DPurpleblue);
+	colbutton = allocimage(display, r, screen->chan, 0, 0x440000FF);
 
 	but2col = allocimage(display, r, screen->chan, 1, 0xAA0000FF);
 	but3col = allocimage(display, r, screen->chan, 1, 0x006600FF);
diff -r eafb71d27315 sys/src/cmd/acme/cols.c
--- a/sys/src/cmd/acme/cols.c	Wed Apr 14 20:30:24 2021 -0700
+++ b/sys/src/cmd/acme/cols.c	Fri Apr 16 07:16:49 2021 +0200
@@ -17,7 +17,7 @@
 	Rectangle r1;
 	Text *t;
 
-	draw(screen, r, display->white, nil, ZP);
+	draw(screen, r, display->black, nil, ZP);
 	c->r = r;
 	c->w = nil;
 	c->nw = 0;
@@ -30,7 +30,7 @@
 	t->what = Columntag;
 	r1.min.y = r1.max.y;
 	r1.max.y += Border;
-	draw(screen, r1, display->black, nil, ZP);
+	draw(screen, r1, tagcols[BORD], nil, ZP);
 	textinsert(t, 0, L"New Cut Paste Snarf Sort Zerox Delcol ", 38, TRUE);
 	textsetselect(t, t->file->nc, t->file->nc);
 	draw(screen, t->scrollr, colbutton, nil, colbutton->r.min);
@@ -79,7 +79,7 @@
 		r1.max.y = min(y, v->body.r.min.y+v->body.nlines*v->body.font->height);
 		r1.min.y = winresize(v, r1, FALSE);
 		r1.max.y = r1.min.y+Border;
-		draw(screen, r1, display->black, nil, ZP);
+		draw(screen, r1, tagcols[BORD], nil, ZP);
 		r.min.y = r1.max.y;
 	}
 	if(w == nil){
@@ -135,7 +135,7 @@
 	memmove(c->w+i, c->w+i+1, (c->nw-i)*sizeof(Window*));
 	c->w = realloc(c->w, c->nw*sizeof(Window*));
 	if(c->nw == 0){
-		draw(screen, r, display->white, nil, ZP);
+		draw(screen, r, display->black, nil, ZP);
 		return;
 	}
 	up = 0;
@@ -197,7 +197,7 @@
 	draw(screen, c->tag.scrollr, colbutton, nil, colbutton->r.min);
 	r1.min.y = r1.max.y;
 	r1.max.y += Border;
-	draw(screen, r1, display->black, nil, ZP);
+	draw(screen, r1, tagcols[BORD], nil, ZP);
 	r1.max.y = r.max.y;
 	new = Dy(r) - c->nw*(Border + font->height);
 	old = Dy(c->r) - c->nw*(Border + font->height);
@@ -213,7 +213,7 @@
 		}
 		r2 = r1;
 		r2.max.y = r2.min.y+Border;
-		draw(screen, r2, display->black, nil, ZP);
+		draw(screen, r2, tagcols[BORD], nil, ZP);
 		r1.min.y = r2.max.y;
 		r1.min.y = winresize(w, r1, FALSE);
 	}
@@ -269,7 +269,7 @@
 			r.max.y = r.min.y+Dy(w->r)+Border;
 		r1 = r;
 		r1.max.y = r1.min.y+Border;
-		draw(screen, r1, display->black, nil, ZP);
+		draw(screen, r1, tagcols[BORD], nil, ZP);
 		r.min.y = r1.max.y;
 		y = winresize(w, r, FALSE);
 	}
@@ -371,7 +371,7 @@
 		}
 		r.min.y = v->r.max.y;
 		r.max.y += Border;
-		draw(screen, r, display->black, nil, ZP);
+		draw(screen, r, tagcols[BORD], nil, ZP);
 		y1 = r.max.y;
 	}
 	/* scan to see new size of everyone below */
@@ -403,7 +403,7 @@
 	if(i < c->nw-1){
 		r.min.y = r.max.y;
 		r.max.y += Border;
-		draw(screen, r, display->black, nil, ZP);
+		draw(screen, r, tagcols[BORD], nil, ZP);
 		for(j=i+1; j<c->nw; j++)
 			ny[j] -= (y2-r.max.y);
 	}
@@ -423,7 +423,7 @@
 		if(j < c->nw-1){	/* no border on last window */
 			r.min.y = v->r.max.y;
 			r.max.y = r.min.y + Border;
-			draw(screen, r, display->black, nil, ZP);
+			draw(screen, r, tagcols[BORD], nil, ZP);
 		}
 		y1 = r.max.y;
 	}
@@ -511,7 +511,7 @@
 	}
 	r.min.y = v->r.max.y;
 	r.max.y = r.min.y+Border;
-	draw(screen, r, display->black, nil, ZP);
+	draw(screen, r, tagcols[BORD], nil, ZP);
 	r.min.y = r.max.y;
 	if(i == c->nw-1)
 		r.max.y = c->r.max.y;
diff -r eafb71d27315 sys/src/cmd/acme/rows.c
--- a/sys/src/cmd/acme/rows.c	Wed Apr 14 20:30:24 2021 -0700
+++ b/sys/src/cmd/acme/rows.c	Fri Apr 16 07:16:49 2021 +0200
@@ -18,7 +18,7 @@
 	Rectangle r1;
 	Text *t;
 
-	draw(screen, r, display->white, nil, ZP);
+	draw(screen, r, display->black, nil, ZP);
 	row->r = r;
 	row->col = nil;
 	row->ncol = 0;
@@ -32,7 +32,7 @@
 	t->col = nil;
 	r1.min.y = r1.max.y;
 	r1.max.y += Border;
-	draw(screen, r1, display->black, nil, ZP);
+	draw(screen, r1, tagcols[BORD], nil, ZP);
 	textinsert(t, 0, L"Newcol Kill Putall Dump Exit ", 29, TRUE);
 	textsetselect(t, t->file->nc, t->file->nc);
 }
@@ -63,7 +63,7 @@
 		r = d->r;
 		if(Dx(r) < 100)
 			return nil;
-		draw(screen, r, display->white, nil, ZP);
+		draw(screen, r, display->black, nil, ZP);
 		r1 = r;
 		r1.max.x = min(x, r.max.x-50);
 		if(Dx(r1) < 50)
@@ -71,7 +71,7 @@
 		colresize(d, r1);
 		r1.min.x = r1.max.x;
 		r1.max.x = r1.min.x+Border;
-		draw(screen, r1, display->black, nil, ZP);
+		draw(screen, r1, tagcols[BORD], nil, ZP);
 		r.min.x = r1.max.x;
 	}
 	if(c == nil){
@@ -105,7 +105,7 @@
 	textresize(&row->tag, r1);
 	r1.min.y = r1.max.y;
 	r1.max.y += Border;
-	draw(screen, r1, display->black, nil, ZP);
+	draw(screen, r1, tagcols[BORD], nil, ZP);
 	r.min.y = r1.max.y;
 	r1 = r;
 	r1.max.x = r1.min.x;
@@ -119,7 +119,7 @@
 		if(i > 0){
 			r2 = r1;
 			r2.max.x = r2.min.x+Border;
-			draw(screen, r2, display->black, nil, ZP);
+			draw(screen, r2, tagcols[BORD], nil, ZP);
 			r1.min.x = r2.max.x;
 		}
 		colresize(c, r1);
@@ -178,14 +178,14 @@
 		p.x = c->r.max.x-80-Scrollwid;
 	r = d->r;
 	r.max.x = c->r.max.x;
-	draw(screen, r, display->white, nil, ZP);
+	draw(screen, r, display->black, nil, ZP);
 	r.max.x = p.x;
 	colresize(d, r);
 	r = c->r;
 	r.min.x = p.x;
 	r.max.x = r.min.x;
 	r.max.x += Border;
-	draw(screen, r, display->black, nil, ZP);
+	draw(screen, r, tagcols[BORD], nil, ZP);
 	r.min.x = r.max.x;
 	r.max.x = c->r.max.x;
 	colresize(c, r);
@@ -210,7 +210,7 @@
 	row->ncol--;
 	row->col = realloc(row->col, row->ncol*sizeof(Column*));
 	if(row->ncol == 0){
-		draw(screen, r, display->white, nil, ZP);
+		draw(screen, r, display->black, nil, ZP);
 		return;
 	}
 	if(i == row->ncol){		/* extend last column right */
@@ -221,7 +221,7 @@
 		c = row->col[i];
 		r.max.x = c->r.max.x;
 	}
-	draw(screen, r, display->white, nil, ZP);
+	draw(screen, r, display->black, nil, ZP);
 	colresize(c, r);
 }
 
@@ -550,12 +550,12 @@
 			r2.min.x = x+Border;
 			if(Dx(r1) < 50 || Dx(r2) < 50)
 				continue;
-			draw(screen, Rpt(r1.min, r2.max), display->white, nil, ZP);
+			draw(screen, Rpt(r1.min, r2.max), display->black, nil, ZP);
 			colresize(c1, r1);
 			colresize(c2, r2);
 			r2.min.x = x;
 			r2.max.x = x+Border;
-			draw(screen, r2, display->black, nil, ZP);
+			draw(screen, r2, tagcols[BORD], nil, ZP);
 		}
 		if(i >= row->ncol)
 			rowadd(row, nil, x);
diff -r eafb71d27315 sys/src/cmd/acme/text.c
--- a/sys/src/cmd/acme/text.c	Wed Apr 14 20:30:24 2021 -0700
+++ b/sys/src/cmd/acme/text.c	Fri Apr 16 07:16:49 2021 +0200
@@ -1190,12 +1190,12 @@
 				pt1 = pt0;
 				reg = region(q, p0);
 				if(reg == 0)
-					frdrawsel0(f, pt0, p0, p1, col, display->white);
+					frdrawsel0(f, pt0, p0, p1, col, display->black);
 			}
 			qt = frptofchar(f, q);
 			if(reg > 0){
 				if(q > p1)
-					frdrawsel0(f, pt1, p1, q, col, display->white);
+					frdrawsel0(f, pt1, p1, q, col, display->black);
 
 				else if(q < p1)
 					selrestore(f, qt, q, p1);
@@ -1203,7 +1203,7 @@
 				if(q > p1)
 					selrestore(f, pt1, p1, q);
 				else
-					frdrawsel0(f, qt, q, p1, col, display->white);
+					frdrawsel0(f, qt, q, p1, col, display->black);
 			}
 			p1 = q;
 			pt1 = qt;