summaryrefslogtreecommitdiff
path: root/vchat-ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'vchat-ui.c')
-rwxr-xr-xvchat-ui.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/vchat-ui.c b/vchat-ui.c
index ffac65e..e2b68d1 100755
--- a/vchat-ui.c
+++ b/vchat-ui.c
@@ -784,7 +784,7 @@ redraw (void)
784void 784void
785resize (int signal) 785resize (int signal)
786{ 786{
787 int xsize,ysize; 787 int xsize,ysize,topicheight=topic?1:0;
788 //errmsg ("! SIGWINCH raised without code for it, hope you didn't make it smaller ;)"); 788 //errmsg ("! SIGWINCH raised without code for it, hope you didn't make it smaller ;)");
789 //endwin(); 789 //endwin();
790 ttgtsz(&xsize,&ysize); 790 ttgtsz(&xsize,&ysize);
@@ -813,16 +813,18 @@ resize (int signal)
813 wresize(console,1,screensx); 813 wresize(console,1,screensx);
814 wresize(input,1,screensx); 814 wresize(input,1,screensx);
815 if (private && !privwinhidden) 815 if (private && !privwinhidden)
816 wresize(private,privheight,screensx); 816 wresize(private,privheight,screensx);
817 wresize(topic,1,screensx); 817 if( topic )
818 wresize(channel, privwinhidden ? screensy - 3 : screensy - (privheight + 3), screensx); 818 wresize(topic,1,screensx);
819 wresize(channel, privwinhidden ? screensy - ( topicheight + 2 ) : screensy - (privheight + ( topicheight + 2 )), screensx);
819 820
820 mvwin(console,screensy-2,0); 821 mvwin(console,screensy-2,0);
821 mvwin(input,screensy-1,0); 822 mvwin(input,screensy-1,0);
822 if(private && !privwinhidden) 823 if(private && !privwinhidden)
823 mvwin(private,0,0); 824 mvwin(private,0,0);
824 mvwin(topic,privwinhidden ? 0 : privheight, 0); 825 if( topic )
825 mvwin(channel,privwinhidden ? 1 : privheight + 1, 0); 826 mvwin(topic,privwinhidden ? 0 : privheight, 0);
827 mvwin(channel,privwinhidden ? topicheight : privheight + topicheight, 0);
826 828
827 drawwin(channel, sb_pub); 829 drawwin(channel, sb_pub);
828 if(private && !privwinhidden ) 830 if(private && !privwinhidden )
@@ -1070,12 +1072,13 @@ initui (void)
1070 console = newwin (1, screensx, screensy - 2, 0); 1072 console = newwin (1, screensx, screensy - 2, 0);
1071 input = newwin (1, screensx, screensy - 1, 0); 1073 input = newwin (1, screensx, screensy - 1, 0);
1072 if (privheight) private = newwin (privheight, screensx, 0, 0); 1074 if (privheight) private = newwin (privheight, screensx, 0, 0);
1073 topic = newwin (1, screensx, privheight, 0); 1075 if( private || getintoption(CF_USETOPIC))
1076 topic = newwin (1, screensx, privheight, 0);
1074 channel = newwin (screensy - (privheight+3), screensx, (privheight+1), 0); 1077 channel = newwin (screensy - (privheight+3), screensx, (privheight+1), 0);
1075 output = newwin (1, screensx, 1, 0); 1078 output = newwin (1, screensx, 1, 0);
1076 1079
1077 /* promblems opening windows? bye! */ 1080 /* promblems opening windows? bye! */
1078 if (!console || !input || !topic || !channel || !output ) 1081 if (!console || !input || (!topic && getintoption(CF_USETOPIC))|| !channel || !output || ( !private && privheight ))
1079 { 1082 {
1080 fprintf (stderr, "vchat-client: could not open windows, bailing out.\n"); 1083 fprintf (stderr, "vchat-client: could not open windows, bailing out.\n");
1081 cleanup (0); 1084 cleanup (0);
@@ -1097,19 +1100,22 @@ initui (void)
1097 if (has_colors()) { 1100 if (has_colors()) {
1098 wattrset (console, COLOR_PAIR (9)); 1101 wattrset (console, COLOR_PAIR (9));
1099 wattrset (input, COLOR_PAIR (0)); 1102 wattrset (input, COLOR_PAIR (0));
1100 wattrset (topic, COLOR_PAIR (9));
1101 wbkgd (output, COLOR_PAIR(8)); 1103 wbkgd (output, COLOR_PAIR(8));
1102 wbkgd (console, COLOR_PAIR (9)); 1104 wbkgd (console, COLOR_PAIR (9));
1103 wbkgd (channel, COLOR_PAIR (0)); 1105 wbkgd (channel, COLOR_PAIR (0));
1104 wbkgd (input, COLOR_PAIR (0)); 1106 wbkgd (input, COLOR_PAIR (0));
1105 if (private) 1107 if (private)
1106 wbkgd (private, COLOR_PAIR (0)); 1108 wbkgd (private, COLOR_PAIR (0));
1107 wbkgd (topic, COLOR_PAIR (9)); 1109 if( topic ) {
1110 wattrset (topic, COLOR_PAIR (9));
1111 wbkgd (topic, COLOR_PAIR (9));
1112 }
1108 } else { 1113 } else {
1109 wattron (console, A_REVERSE); 1114 wattron (console, A_REVERSE);
1110 wattron (topic, A_REVERSE);
1111 wattron (output, A_REVERSE); 1115 wattron (output, A_REVERSE);
1112 wbkgd(output, A_REVERSE); 1116 wbkgd(output, A_REVERSE);
1117 if( topic )
1118 wattron (topic, A_REVERSE);
1113 } 1119 }
1114 1120
1115 /* set some options */ 1121 /* set some options */
@@ -1293,6 +1299,9 @@ topicline (unsigned char *message)
1293 int i; 1299 int i;
1294 ncurs_attr old_att, new_att; 1300 ncurs_attr old_att, new_att;
1295 1301
1302 if( !topic )
1303 return;
1304
1296 memset( &new_att, 0, sizeof(new_att)); 1305 memset( &new_att, 0, sizeof(new_att));
1297 BCOLR_SET( (&new_att), 8 ); 1306 BCOLR_SET( (&new_att), 8 );
1298 1307