diff --git a/Source/CandidateUI/VTVerticalCandidateController.m b/Source/CandidateUI/VTVerticalCandidateController.m index 75d2ea10..7684806d 100644 --- a/Source/CandidateUI/VTVerticalCandidateController.m +++ b/Source/CandidateUI/VTVerticalCandidateController.m @@ -41,7 +41,6 @@ static const CGFloat kCandidateTextLeftMargin = 8.0; - (BOOL)scrollPageByOne:(BOOL)forward; - (BOOL)moveSelectionByOne:(BOOL)forward; - (void)layoutCandidateView; -- (void)forceUpdateVerticalScroller; @end @implementation VTVerticalCandidateController @@ -254,6 +253,13 @@ static const CGFloat kCandidateTextLeftMargin = 8.0; NSInteger firstVisibleRow = [_tableView rowAtPoint:[_scrollView documentVisibleRect].origin]; _keyLabelStripView.highlightedIndex = selectedRow - firstVisibleRow; [_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)]; [[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