add an extra check when determining if the message window should be scrolled to the bottom

This commit is contained in:
Mitchell Livingston 2009-10-19 02:44:04 +00:00
parent 1fec35c944
commit 3e26db6ed0
1 changed files with 5 additions and 3 deletions

View File

@ -143,6 +143,11 @@
return;
static NSUInteger currentIndex = 0;
NSScroller * scroller = [[fMessageTable enclosingScrollView] verticalScroller];
const BOOL shouldScroll = currentIndex == 0 || [scroller floatValue] == 1.0 || [scroller isHidden]
|| [scroller knobProportion] == 1.0;
for (tr_msg_list * currentMessage = messages; currentMessage != NULL; currentMessage = currentMessage->next)
{
NSString * name = currentMessage->name != NULL ? [NSString stringWithUTF8String: currentMessage->name]
@ -162,9 +167,6 @@
tr_freeMessageList(messages);
NSScroller * scroller = [[fMessageTable enclosingScrollView] verticalScroller];
const BOOL shouldScroll = [scroller floatValue] == 1.0 || [scroller isHidden] || [scroller knobProportion] == 1.0;
NSUInteger total = [fMessages count];
if (total > MAX_MESSAGES)
{