Correctly fix the vertical scroller redraw issue.
This commit is contained in:
parent
1033c74de6
commit
07f663eb00
|
@ -41,7 +41,6 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
||||||
- (BOOL)scrollPageByOne:(BOOL)forward;
|
- (BOOL)scrollPageByOne:(BOOL)forward;
|
||||||
- (BOOL)moveSelectionByOne:(BOOL)forward;
|
- (BOOL)moveSelectionByOne:(BOOL)forward;
|
||||||
- (void)layoutCandidateView;
|
- (void)layoutCandidateView;
|
||||||
- (void)forceUpdateVerticalScroller;
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation VTVerticalCandidateController
|
@implementation VTVerticalCandidateController
|
||||||
|
@ -254,6 +253,13 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
||||||
NSInteger firstVisibleRow = [_tableView rowAtPoint:[_scrollView documentVisibleRect].origin];
|
NSInteger firstVisibleRow = [_tableView rowAtPoint:[_scrollView documentVisibleRect].origin];
|
||||||
_keyLabelStripView.highlightedIndex = selectedRow - firstVisibleRow;
|
_keyLabelStripView.highlightedIndex = selectedRow - firstVisibleRow;
|
||||||
[_keyLabelStripView setNeedsDisplay:YES];
|
[_keyLabelStripView setNeedsDisplay:YES];
|
||||||
|
|
||||||
|
// fix a subtle OS X "bug" that, since we force the scroller to appear,
|
||||||
|
// scrolling sometimes shows a temporarily "broken" scroll bar
|
||||||
|
// (but quickly disappears)
|
||||||
|
if ([_scrollView hasVerticalScroller]) {
|
||||||
|
[[_scrollView verticalScroller] setNeedsDisplay];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,15 +398,4 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
||||||
[_scrollView setFrame:NSMakeRect(stripWidth + 1.0, 0.0, tableViewStartWidth, windowHeight)];
|
[_scrollView setFrame:NSMakeRect(stripWidth + 1.0, 0.0, tableViewStartWidth, windowHeight)];
|
||||||
[[self window] setFrame:frameRect display:YES];
|
[[self window] setFrame:frameRect display:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)forceUpdateVerticalScroller
|
|
||||||
{
|
|
||||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(deferredForceUpdateVerticalScroller) object:nil];
|
|
||||||
[self performSelector:@selector(deferredForceUpdateVerticalScroller) withObject:nil afterDelay:0.0];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)deferredForceUpdateVerticalScroller
|
|
||||||
{
|
|
||||||
[[_scrollView verticalScroller] setNeedsDisplay];
|
|
||||||
}
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue