shithub: lola

Download patch

ref: c4e37b237a8fdeda353f74af69d5c57983e84cd3
parent: 9c38a9649a00dd85689f55a1eef23a14cf5a82e3
author: aap <[email protected]>
date: Tue Sep 3 02:33:40 EDT 2024

little changes to color schemes

--- a/data.c
+++ b/data.c
@@ -213,16 +213,6 @@
 void
 initdata(void)
 {
-	background = getcolor("background", 0x777777FF);
-	colors[BACK] = getcolor("back", 0xFFFFFFFF);
-	colors[HIGH] = getcolor("high", 0xCCCCCCFF);
-	colors[BORD] = getcolor("bord", 0x999999FF);
-	colors[TEXT] = getcolor("text", 0x000000FF);
-	colors[HTEXT] = getcolor("htext", 0x000000FF);
-	colors[PALETEXT] = getcolor("paletext", 0x666666FF);
-	colors[HOLDTEXT] = getcolor("holdtext", DMedblue);
-	colors[PALEHOLDTEXT] = getcolor("paleholdtext", DGreyblue);
-
 	// this is probably dumb.
 	pal[0] = mkcolor(0x00000000);
 	pal[1] = mkcolor(0x000000FF);
@@ -234,4 +224,24 @@
 	pal[7] = mkcolor(0xC0C7C8FF);
 
 	inittheme();
+
+	/* these might have already been set by the theme */
+	if(background == nil)
+		background = getcolor("background", 0x777777FF);
+	if(colors[BACK] == nil)
+		colors[BACK] = getcolor("back", 0xFFFFFFFF);
+	if(colors[HIGH] == nil)
+		colors[HIGH] = getcolor("high", 0xCCCCCCFF);
+	if(colors[BORD] == nil)
+		colors[BORD] = getcolor("bord", 0x999999FF);
+	if(colors[TEXT] == nil)
+		colors[TEXT] = getcolor("text", 0x000000FF);
+	if(colors[HTEXT] == nil)
+		colors[HTEXT] = getcolor("htext", 0x000000FF);
+	if(colors[PALETEXT] == nil)
+		colors[PALETEXT] = getcolor("paletext", 0x666666FF);
+	if(colors[HOLDTEXT] == nil)
+		colors[HOLDTEXT] = getcolor("holdtext", DMedblue);
+	if(colors[PALEHOLDTEXT] == nil)
+		colors[PALEHOLDTEXT] = getcolor("paleholdtext", DGreyblue);
 }
--- a/main.c
+++ b/main.c
@@ -1057,6 +1057,9 @@
 	gotscreen = access("/dev/screen", AEXIST)==0;
 
 	initdata();
+	/* hack to get menu colors referenced,
+	 * so setting them with initstr will work */
+	btn12menu();
 
 	wscreen = allocscreen(screen, background, 0);
 	fakebg = allocwindow(wscreen, screen->r, Refbackup, DNofill);
--- a/win3.c
+++ b/win3.c
@@ -317,6 +317,8 @@
 void
 inittheme(void)
 {
+	background = getcolor("background", 0xC0C7C8FF);
+
 	wincolors[ColDefault] = getcolor("button_face", 0xC0C7C8FF);
 	wincolors[ColHilight] = getcolor("button_hilight", 0xFFFFFFFF);
 	wincolors[ColShadow] = getcolor("button_shadow", 0x87888FFF);
--- a/win95.c
+++ b/win95.c
@@ -258,8 +258,11 @@
 void
 inittheme(void)
 {
+	background = getcolor("background", 0x008080FF);
+
 	wincolors[ColDefault] = getcolor("3d_face", 0xC0C0C0FF);
-	wincolors[ColLight1] = getcolor("3d_hilight1", 0xDFDFDFFF);
+//	wincolors[ColLight1] = getcolor("3d_hilight1", 0xDFDFDFFF);
+	wincolors[ColLight1] = getcolor("3d_hilight1", 0xC0C0C0FF);
 	wincolors[ColLight2] = getcolor("3d_hilight2", 0xFFFFFFFF);
 	wincolors[ColDark1] = getcolor("3d_shadow1", 0x808080FF);
 	wincolors[ColDark2] = getcolor("3d_shadow2", 0x000000FF);