summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2022-05-21 13:42:44 +0200
committerDirk Engling <erdgeist@erdgeist.org>2022-05-21 13:42:44 +0200
commitdc6e13b39ba2190d7f11378be48f8ccfe10d47f6 (patch)
treed8dc929193be64f4513df17c832f4f371ac01956
parent40e8d51a27f85dc7cac8c685add574d48a997180 (diff)
Add an option to invert the window bars instead of coloring them
-rwxr-xr-xvchat-config.h1
-rwxr-xr-xvchat-ui.c20
-rwxr-xr-xvchat.h2
3 files changed, 17 insertions, 6 deletions
diff --git a/vchat-config.h b/vchat-config.h
index 89cf231..56e0b60 100755
--- a/vchat-config.h
+++ b/vchat-config.h
@@ -50,6 +50,7 @@ static volatile configoption configoptions[] = {
50 {CF_USETOPIC, CO_INT, "usetopicbar",(char *) 1, (char *)-1, { NULL } }, 50 {CF_USETOPIC, CO_INT, "usetopicbar",(char *) 1, (char *)-1, { NULL } },
51 {CF_PRIVHEIGHT, CO_INT, "messages", (char *) 0, (char *)-1, { NULL } }, 51 {CF_PRIVHEIGHT, CO_INT, "messages", (char *) 0, (char *)-1, { NULL } },
52 {CF_PRIVCOLLAPS, CO_INT, "privcollaps",(char *) 0, (char *)-1, { NULL } }, 52 {CF_PRIVCOLLAPS, CO_INT, "privcollaps",(char *) 0, (char *)-1, { NULL } },
53 {CF_INVWINBAR, CO_INT, "invwinbar", (char *) 0, (char *)-1, { NULL } },
53 {CF_HSCROLL, CO_INT, "hscroll", (char *)15, (char *)-1, { .pint = &hscroll } }, 54 {CF_HSCROLL, CO_INT, "hscroll", (char *)15, (char *)-1, { .pint = &hscroll } },
54 {CF_CHANNEL, CO_INT, "channel", (char *) 0, (char *)-1, { NULL } }, 55 {CF_CHANNEL, CO_INT, "channel", (char *) 0, (char *)-1, { NULL } },
55 {CF_SCROLLBPRIV, CO_INT, "privscrollb",(char *) 2048, (char *)-1, { NULL } }, 56 {CF_SCROLLBPRIV, CO_INT, "privscrollb",(char *) 2048, (char *)-1, { NULL } },
diff --git a/vchat-ui.c b/vchat-ui.c
index a55f7f8..62ef372 100755
--- a/vchat-ui.c
+++ b/vchat-ui.c
@@ -1150,17 +1150,27 @@ initui (void)
1150 1150
1151 /* set colors for windows */ 1151 /* set colors for windows */
1152 if (has_colors()) { 1152 if (has_colors()) {
1153 wattrset (console, COLOR_PAIR (9)); 1153 if (getintoption(CF_INVWINBAR)) {
1154 wbkgd (console, COLOR_PAIR (0));
1155 wattron (console, A_REVERSE);
1156 } else {
1157 wattrset (console, COLOR_PAIR (9));
1158 wbkgd (console, COLOR_PAIR (9));
1159 }
1154 wattrset (input, COLOR_PAIR (0)); 1160 wattrset (input, COLOR_PAIR (0));
1155 wbkgd (output, COLOR_PAIR(8)); 1161 wbkgd (output, COLOR_PAIR(8));
1156 wbkgd (console, COLOR_PAIR (9));
1157 wbkgd (channel, COLOR_PAIR (0)); 1162 wbkgd (channel, COLOR_PAIR (0));
1158 wbkgd (input, COLOR_PAIR (0)); 1163 wbkgd (input, COLOR_PAIR (0));
1159 if (private) 1164 if (private)
1160 wbkgd (private, COLOR_PAIR (0)); 1165 wbkgd (private, COLOR_PAIR (0));
1161 if( topic ) { 1166 if (topic) {
1162 wattrset (topic, COLOR_PAIR (9)); 1167 if (getintoption(CF_INVWINBAR)) {
1163 wbkgd (topic, COLOR_PAIR (9)); 1168 wbkgd (input, COLOR_PAIR (0));
1169 wattron(topic, A_REVERSE);
1170 } else {
1171 wattrset (topic, COLOR_PAIR (9));
1172 wbkgd (topic, COLOR_PAIR (9));
1173 }
1164 } 1174 }
1165 } else { 1175 } else {
1166 wattron (console, A_REVERSE); 1176 wattron (console, A_REVERSE);
diff --git a/vchat.h b/vchat.h
index 71ad149..54fd006 100755
--- a/vchat.h
+++ b/vchat.h
@@ -32,7 +32,7 @@ typedef enum { CO_NIL, CO_STR, CO_INT } conftype;
32typedef enum { CF_NIL, CF_NICK, CF_FROM, CF_SERVERHOST, CF_SERVERPORT, 32typedef enum { CF_NIL, CF_NICK, CF_FROM, CF_SERVERHOST, CF_SERVERPORT,
33CF_CIPHERSUITE, CF_CONFIGFILE, CF_CERTFILE, CF_KEYFILE, CF_CAFILE, CF_FORMFILE, 33CF_CIPHERSUITE, CF_CONFIGFILE, CF_CERTFILE, CF_KEYFILE, CF_CAFILE, CF_FORMFILE,
34CF_LOGINSCRIPT, CF_FINGERPRINT, CF_PINFINGER, CF_USESSL, CF_IGNSSL, CF_VERIFYSSL, CF_USECERT, 34CF_LOGINSCRIPT, CF_FINGERPRINT, CF_PINFINGER, CF_USESSL, CF_IGNSSL, CF_VERIFYSSL, CF_USECERT,
35CF_PRIVHEIGHT, CF_PRIVCOLLAPS, CF_HSCROLL, CF_CHANNEL, CF_USETIME, CF_USETOPIC, 35CF_PRIVHEIGHT, CF_PRIVCOLLAPS, CF_INVWINBAR, CF_HSCROLL, CF_CHANNEL, CF_USETIME, CF_USETOPIC,
36CF_SCROLLBPRIV, CF_SCROLLBACK, CF_SCROLLBPRIVT, CF_SCROLLBACKT, CF_ENCODING, 36CF_SCROLLBPRIV, CF_SCROLLBACK, CF_SCROLLBPRIVT, CF_SCROLLBACKT, CF_ENCODING,
37CF_BELLPRIV, CF_CASEFIRST, CF_AUTORECONN, CF_KEEPALIVE } confopt; 37CF_BELLPRIV, CF_CASEFIRST, CF_AUTORECONN, CF_KEEPALIVE } confopt;
38 38