Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/screen.c @ 39:416fd026d76d
[/trunk] Changeset 55 by mikael
* Increase roster's weight. Fixed weight of ROSTER_WEIGHT=24 for now.
author | mikael |
---|---|
date | Mon, 04 Apr 2005 20:55:03 +0000 |
parents | a8ceaa3005fd |
children | 82247685b14b |
comparison
equal
deleted
inserted
replaced
38:881d8eb379c6 | 39:416fd026d76d |
---|---|
389 else if ((!force_show) && ((!currentWindow || (currentWindow != tmp)))) | 389 else if ((!force_show) && ((!currentWindow || (currentWindow != tmp)))) |
390 dont_show = TRUE; | 390 dont_show = TRUE; |
391 // scr_LogPrint("dont_show=%d", dont_show); | 391 // scr_LogPrint("dont_show=%d", dont_show); |
392 | 392 |
393 if (tmp == NULL) { | 393 if (tmp == NULL) { |
394 tmp = scr_CreatePanel(winId, 20, 0, CHAT_WIN_HEIGHT, maxX - 20, dont_show); | 394 tmp = scr_CreatePanel(winId, ROSTER_WEIGHT, 0, CHAT_WIN_HEIGHT, |
395 maxX - ROSTER_WEIGHT, dont_show); | |
395 tmp->texto = (char **) calloc((CHAT_WIN_HEIGHT+1) * 3, sizeof(char *)); | 396 tmp->texto = (char **) calloc((CHAT_WIN_HEIGHT+1) * 3, sizeof(char *)); |
396 for (n = 0; n < CHAT_WIN_HEIGHT * 3; n++) | 397 for (n = 0; n < CHAT_WIN_HEIGHT * 3; n++) |
397 tmp->texto[n] = (char *) calloc(1, 1024); | 398 tmp->texto[n] = (char *) calloc(1, 1024); |
398 | 399 |
399 if (TimeStamp) { | 400 if (TimeStamp) { |
471 } | 472 } |
472 | 473 |
473 void scr_DrawMainWindow(void) | 474 void scr_DrawMainWindow(void) |
474 { | 475 { |
475 /* Draw main panels */ | 476 /* Draw main panels */ |
476 rosterWnd = newwin(CHAT_WIN_HEIGHT, 20, 0, 0); | 477 rosterWnd = newwin(CHAT_WIN_HEIGHT, ROSTER_WEIGHT, 0, 0); |
477 rosterPanel = new_panel(rosterWnd); | 478 rosterPanel = new_panel(rosterWnd); |
478 scr_draw_box(rosterWnd, 0, 0, CHAT_WIN_HEIGHT, 20, COLOR_GENERAL, 0, 0); | 479 scr_draw_box(rosterWnd, 0, 0, CHAT_WIN_HEIGHT, ROSTER_WEIGHT, COLOR_GENERAL, 0, 0); |
479 mvwprintw(rosterWnd, 0, (20 - strlen(i18n("Roster"))) / 2, | 480 mvwprintw(rosterWnd, 0, (ROSTER_WEIGHT - strlen(i18n("Roster"))) / 2, |
480 i18n("Roster")); | 481 i18n("Roster")); |
481 | 482 |
482 chatWnd = newwin(CHAT_WIN_HEIGHT, maxX - 20, 0, 20); | 483 chatWnd = newwin(CHAT_WIN_HEIGHT, maxX - ROSTER_WEIGHT, 0, ROSTER_WEIGHT); |
483 chatPanel = new_panel(chatWnd); | 484 chatPanel = new_panel(chatWnd); |
484 scr_draw_box(chatWnd, 0, 0, CHAT_WIN_HEIGHT, maxX - 20, COLOR_GENERAL, 0, 0); | 485 scr_draw_box(chatWnd, 0, 0, CHAT_WIN_HEIGHT, maxX - ROSTER_WEIGHT, COLOR_GENERAL, 0, 0); |
485 //mvwprintw(chatWnd, 0, | 486 //mvwprintw(chatWnd, 0, |
486 // ((maxX - 20) - strlen(i18n("Status Window"))) / 2, | 487 // ((maxX - 20) - strlen(i18n("Status Window"))) / 2, |
487 // i18n("Status Window")); | 488 // i18n("Status Window")); |
488 //wbkgd(chatWnd, COLOR_PAIR(COLOR_GENERAL)); | 489 //wbkgd(chatWnd, COLOR_PAIR(COLOR_GENERAL)); |
489 mvwprintw(chatWnd, 1, 1, "This is the status window"); | 490 mvwprintw(chatWnd, 1, 1, "This is the status window"); |
528 char *buffer = (char *) malloc(5 + strlen(text)); | 529 char *buffer = (char *) malloc(5 + strlen(text)); |
529 | 530 |
530 sprintf(buffer, "<== %s", utf8_decode(text)); | 531 sprintf(buffer, "<== %s", utf8_decode(text)); |
531 | 532 |
532 submsgs = | 533 submsgs = |
533 ut_SplitMessage(buffer, &n, maxX - scr_WindowHeight(rosterWnd) - 20); | 534 ut_SplitMessage(buffer, &n, maxX - scr_WindowHeight(rosterWnd) - ROSTER_WEIGHT); |
534 | 535 |
535 for (i = 0; i < n; i++) { | 536 for (i = 0; i < n; i++) { |
536 if (i == 0) | 537 if (i == 0) |
537 scr_WriteInWindow(jidfrom, submsgs[i], TRUE, FALSE); | 538 scr_WriteInWindow(jidfrom, submsgs[i], TRUE, FALSE); |
538 else | 539 else |
622 | 623 |
623 sprintf(buffer, "--> %s", msg); | 624 sprintf(buffer, "--> %s", msg); |
624 | 625 |
625 submsgs = | 626 submsgs = |
626 ut_SplitMessage(buffer, &n, | 627 ut_SplitMessage(buffer, &n, |
627 maxX - scr_WindowHeight(rosterWnd) - 20); | 628 maxX - scr_WindowHeight(rosterWnd) - ROSTER_WEIGHT); |
628 for (i = 0; i < n; i++) { | 629 for (i = 0; i < n; i++) { |
629 if (i == 0) | 630 if (i == 0) |
630 scr_WriteInWindow(tmp->jid, submsgs[i], TRUE, TRUE); | 631 scr_WriteInWindow(tmp->jid, submsgs[i], TRUE, TRUE); |
631 else | 632 else |
632 scr_WriteInWindow(tmp->jid, submsgs[i], FALSE, TRUE); | 633 scr_WriteInWindow(tmp->jid, submsgs[i], FALSE, TRUE); |