shithub: patch

Download patch

ref: fd24485a39c844fde8c7754a51991df3ab9fad93
parent: 6ed9362e5e1e68acbda5de1f1f9ada33a0dcb2e6
author: qwx <qwx@sciops.net>
date: Wed Mar 9 12:16:37 EST 2022

remove libdraw colorshit

--- a/libdraw-menucol
+++ /dev/null
@@ -1,72 +1,0 @@
-mouse menu color patch
-
-diff -r d4af852fff2d sys/src/libdraw/emenuhit.c
---- a/sys/src/libdraw/emenuhit.c	Sat Aug 08 09:20:48 2015 +0200
-+++ b/sys/src/libdraw/emenuhit.c	Sat Aug 15 02:08:58 2015 +0300
-@@ -27,13 +27,14 @@
- menucolors(void)
- {
- 	/* Main tone is greenish, with negative selection */
--	back = allocimagemix(display, DPalegreen, DWhite);
--	high = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DDarkgreen);	/* dark green */
--	bord = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DMedgreen);	/* not as dark green */
--	if(back==nil || high==nil || bord==nil)
-+	text = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x884400FF);
-+	high = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x884400FF);
-+	bord = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x440000FF);
-+	if(text==nil || high==nil || bord==nil)
- 		goto Error;
--	text = display->black;
-+	back = display->black;
- 	htext = back;
-+	menutxt = high;
- 	return;
- 
-     Error:
-@@ -149,10 +150,7 @@
- 	if(r.max.y < r.min.y+2)
- 		r.max.y = r.min.y+2;
- 	border(screen, r, 1, bord, ZP);
--	if(menutxt == 0)
--		menutxt = allocimage(display, Rect(0, 0, 1, 1), CMAP8, 1, DDarkgreen);
--	if(menutxt)
--		draw(screen, insetrect(r, 1), menutxt, nil, ZP);
-+	draw(screen, insetrect(r, 1), menutxt, nil, ZP);
- }
- 
- int
-diff -r d4af852fff2d sys/src/libdraw/menuhit.c
---- a/sys/src/libdraw/menuhit.c	Sat Aug 08 09:20:48 2015 +0200
-+++ b/sys/src/libdraw/menuhit.c	Sat Aug 15 02:08:58 2015 +0300
-@@ -28,13 +28,14 @@
- menucolors(void)
- {
- 	/* Main tone is greenish, with negative selection */
--	back = allocimagemix(display, DPalegreen, DWhite);
--	high = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkgreen);	/* dark green */
--	bord = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DMedgreen);	/* not as dark green */
--	if(back==nil || high==nil || bord==nil)
-+	text = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x884400FF);
-+	high = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x884400FF);
-+	bord = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x440000FF);
-+	if(text==nil || high==nil || bord==nil)
- 		goto Error;
--	text = display->black;
-+	back = display->black;
- 	htext = back;
-+	menutxt = high;
- 	return;
- 
-     Error:
-@@ -146,10 +147,7 @@
- 	if(r.max.y < r.min.y+2)
- 		r.max.y = r.min.y+2;
- 	border(m, r, 1, bord, ZP);
--	if(menutxt == 0)
--		menutxt = allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, DDarkgreen);	/* border color; BUG? */
--	if(menutxt)
--		draw(m, insetrect(r, 1), menutxt, nil, ZP);
-+	draw(m, insetrect(r, 1), menutxt, nil, ZP);
- }
- 
- int
--- a/libdraw-pastelmenucol
+++ /dev/null
@@ -1,68 +1,0 @@
---- a//sys/src/libdraw/emenuhit.c
-+++ b//sys/src/libdraw/emenuhit.c
-@@ -27,13 +27,14 @@
- menucolors(void)
- {
- 	/* Main tone is greenish, with negative selection */
--	back = allocimagemix(display, DPalegreen, DWhite);
--	high = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DDarkgreen);	/* dark green */
--	bord = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DMedgreen);	/* not as dark green */
--	if(back==nil || high==nil || bord==nil)
-+	text = display->white;
-+	high = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x9C9C9CFF);
-+	bord = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xDEDEDEFF);
-+	if(text==nil || high==nil || bord==nil)
- 		goto Error;
--	text = display->black;
-+	back = display->black;
- 	htext = back;
-+	menutxt = high;
- 	return;
- 
-     Error:
-@@ -149,10 +150,7 @@
- 	if(r.max.y < r.min.y+2)
- 		r.max.y = r.min.y+2;
- 	border(screen, r, 1, bord, ZP);
--	if(menutxt == 0)
--		menutxt = allocimage(display, Rect(0, 0, 1, 1), CMAP8, 1, DDarkgreen);
--	if(menutxt)
--		draw(screen, insetrect(r, 1), menutxt, nil, ZP);
-+	draw(screen, insetrect(r, 1), menutxt, nil, ZP);
- }
- 
- int
---- a//sys/src/libdraw/menuhit.c
-+++ b//sys/src/libdraw/menuhit.c
-@@ -28,13 +28,14 @@
- menucolors(void)
- {
- 	/* Main tone is greenish, with negative selection */
--	back = allocimagemix(display, DPalegreen, DWhite);
--	high = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkgreen);	/* dark green */
--	bord = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DMedgreen);	/* not as dark green */
--	if(back==nil || high==nil || bord==nil)
-+	text = display->white;
-+	high = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x9C9C9CFF);
-+	bord = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xDEDEDEFF);
-+	if(text==nil || high==nil || bord==nil)
- 		goto Error;
--	text = display->black;
-+	back = display->black;
- 	htext = back;
-+	menutxt = high;
- 	return;
- 
-     Error:
-@@ -146,10 +147,7 @@
- 	if(r.max.y < r.min.y+2)
- 		r.max.y = r.min.y+2;
- 	border(m, r, 1, bord, ZP);
--	if(menutxt == 0)
--		menutxt = allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, DDarkgreen);	/* border color; BUG? */
--	if(menutxt)
--		draw(m, insetrect(r, 1), menutxt, nil, ZP);
-+	draw(m, insetrect(r, 1), menutxt, nil, ZP);
- }
- 
- int