Mercurial > hg
comparison mcabber/src/screen.c @ 680:1f8987e0e56c
Try to display as many buddylist items as possible
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 28 Jan 2006 18:02:24 +0100 |
parents | 5933a8036672 |
children | f3945593432e |
comparison
equal
deleted
inserted
replaced
679:5933a8036672 | 680:1f8987e0e56c |
---|---|
711 | 711 |
712 // We can reset update_roster | 712 // We can reset update_roster |
713 update_roster = FALSE; | 713 update_roster = FALSE; |
714 | 714 |
715 getmaxyx(rosterWnd, maxy, maxx); | 715 getmaxyx(rosterWnd, maxy, maxx); |
716 maxx --; // last char is for vertical border | 716 maxx--; // last char is for vertical border |
717 name[ROSTER_WIDTH-7] = 0; | 717 name[ROSTER_WIDTH-7] = 0; |
718 | 718 |
719 // cleanup of roster window | 719 // cleanup of roster window |
720 werase(rosterWnd); | 720 werase(rosterWnd); |
721 // Redraw the vertical line (not very good...) | 721 // Redraw the vertical line (not very good...) |
730 doupdate(); | 730 doupdate(); |
731 return; | 731 return; |
732 } | 732 } |
733 | 733 |
734 // Update offset if necessary | 734 // Update offset if necessary |
735 // a) Try to show as many buddylist items as possible | |
736 i = g_list_length(buddylist) - maxy; | |
737 if (0 <= i && i < offset) | |
738 offset = i; | |
739 // b) Make sure the current_buddy is visible | |
735 i = g_list_position(buddylist, current_buddy); | 740 i = g_list_position(buddylist, current_buddy); |
736 if (i == -1) { // This is bad | 741 if (i == -1) { // This is bad |
737 scr_LogPrint(LPRINT_NORMAL, "Doh! Can't find current selected buddy!!"); | 742 scr_LogPrint(LPRINT_NORMAL, "Doh! Can't find current selected buddy!!"); |
738 return; | 743 return; |
739 } else if (i < offset) { | 744 } else if (i < offset) { |