mirror of
https://github.com/transmission/transmission
synced 2025-01-31 19:34:05 +00:00
scroll the message log to the bottom on update of the message log when it's already scrolled to the bottom
This commit is contained in:
parent
e781dfb03d
commit
0eec065df9
2 changed files with 7 additions and 2 deletions
|
@ -28,10 +28,10 @@
|
|||
|
||||
@implementation GradientCell
|
||||
|
||||
#warning switch to image cell
|
||||
- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView
|
||||
{
|
||||
NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: cellFrame radius: 4.0];
|
||||
[[self objectValue] fillBezierPath: bp angle: 90];
|
||||
[[self objectValue] fillBezierPath: [NSBezierPath bezierPathWithRoundedRect: cellFrame radius: 4.0] angle: 90];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -135,6 +135,9 @@
|
|||
|
||||
tr_freeMessageList(messages);
|
||||
|
||||
NSScroller * scroller = [[fMessageTable enclosingScrollView] verticalScroller];
|
||||
BOOL shouldScroll = [scroller floatValue] == 1.0 || [scroller isHidden] || [scroller knobProportion] == 1.0;
|
||||
|
||||
int total = [fMessages count];
|
||||
if (total > MAX_MESSAGES)
|
||||
{
|
||||
|
@ -152,6 +155,8 @@
|
|||
[fMessages sortUsingDescriptors: [fMessageTable sortDescriptors]];
|
||||
|
||||
[fMessageTable reloadData];
|
||||
if (shouldScroll)
|
||||
[fMessageTable scrollRowToVisible: total-1];
|
||||
}
|
||||
|
||||
- (int) numberOfRowsInTableView: (NSTableView *) tableView
|
||||
|
|
Loading…
Reference in a new issue