No right/bot scrollbar -> no resize indicator

The resize indicator covers the text view when there is no right or
bottom scrollbar so don't draw it in this situation.  Also avoids a
display corruption when using Core Text renderer with ":set go-=r".
This commit is contained in:
Bjorn Winckler
2010-07-25 16:49:05 +02:00
parent 1623ced00c
commit 9bd07078ed
+8
View File
@@ -663,6 +663,7 @@ enum {
{
NSRect textViewFrame = [textView frame];
BOOL lsbVisible = [self leftScrollbarVisible];
BOOL botOrRightSbVisible = NO;
// HACK! Find the lowest left&right vertical scrollbars, as well as the
// rightmost horizontal scrollbar. This hack continues further down.
@@ -686,10 +687,12 @@ enum {
&& range.location >= rowMaxRight) {
rowMaxRight = range.location;
lowestRightSbIdx = i;
botOrRightSbVisible = YES;
} else if ([scroller type] == MMScrollerTypeBottom
&& range.location >= colMax) {
colMax = range.location;
rightmostSbIdx = i;
botOrRightSbVisible = YES;
}
}
}
@@ -778,6 +781,11 @@ enum {
[scroller setNeedsDisplay:YES];
}
}
// HACK: If there is no bottom or right scrollbar the resize indicator will
// cover the bottom-right corner of the text view so tell NSWindow not to
// draw it in this situation.
[[self window] setShowsResizeIndicator:botOrRightSbVisible];
}
- (NSUInteger)representedIndexOfTabViewItem:(NSTabViewItem *)tvi