adium 4299:de1960114cf5: Fix user-scrolling in AIAutoScrollTextV...
commits at adium.im
commits at adium.im
Mon Nov 14 15:24:57 UTC 2011
details: http://hg.adium.im/adium/rev/de1960114cf5
revision: 4299:de1960114cf5
branch: (none)
author: Patrick Steinhardt <steinhardt.p at me.com>
date: Mon Nov 14 16:24:44 2011 +0100
Fix user-scrolling in AIAutoScrollTextView. Fixes #15456.
diffs (64 lines):
diff -r 7980394fb632 -r de1960114cf5 Source/AIAutoScrollTextView.m
--- a/Source/AIAutoScrollTextView.m Mon Nov 14 12:49:26 2011 +0100
+++ b/Source/AIAutoScrollTextView.m Mon Nov 14 16:24:44 2011 +0100
@@ -64,7 +64,6 @@
[self stopScrolling];
} else{
[self startScrolling];
-
}
}
@@ -72,7 +71,7 @@
- (void)mouseExited:(NSEvent *)theEvent
{
if (!scrollTimer) {
- [self startScrolling];
+ [self startScrolling];
}
[super mouseExited:theEvent];
@@ -80,11 +79,10 @@
- (void)startScrolling
{
+ [[self enclosingScrollView] setHasVerticalScroller:NO];
[[self enclosingScrollView] setLineScroll:0.0f];
[[self enclosingScrollView] setPageScroll:0.0f];
- [[self enclosingScrollView] setVerticalScroller:nil];
- [[self enclosingScrollView] setHasVerticalScroller:NO];
-
+
// Start scrolling
scrollLocation = [[[self enclosingScrollView] contentView] bounds].origin.y;
maxScroll = [[self textStorage] size].height;
@@ -100,11 +98,16 @@
{
[scrollTimer invalidate]; [scrollTimer release]; scrollTimer = nil;
- // Enable scrolling and show the scrollbar
- [[self enclosingScrollView] setLineScroll:10.0f];
+ // Enable scrolling
+ [[self enclosingScrollView] setHasVerticalScroller:YES];
+ [[self enclosingScrollView] setLineScroll:10.0f];
[[self enclosingScrollView] setPageScroll:10.0f];
- [[self enclosingScrollView] setVerticalScroller:[[[NSScroller alloc] init] autorelease]];
- [[self enclosingScrollView] setHasVerticalScroller:YES];
+
+ /*
+ * Scroll to correct location, otherwise scrolling will start
+ * at the end of the last manual scroll
+ */
+ [[[self enclosingScrollView] contentView] scrollPoint:NSMakePoint(0, scrollLocation)];
}
// Scroll the credits
@@ -115,7 +118,7 @@
if (scrollLocation > maxScroll || scrollLocation < 0) {
scrollLocation = 0;
}
-
+
[self scrollPoint:NSMakePoint(0, scrollLocation)];
}
More information about the commits
mailing list