More scroll view refinements.

This commit is contained in:
Pietro Gagliardi 2016-05-28 00:35:56 -04:00
parent c74ac88598
commit 119825f0de
2 changed files with 4 additions and 4 deletions

View File

@ -171,7 +171,8 @@ static uiMultilineEntry *finishMultilineEntry(BOOL hscroll)
memset(&p, 0, sizeof (struct scrollViewCreateParams)); memset(&p, 0, sizeof (struct scrollViewCreateParams));
p.DocumentView = e->tv; p.DocumentView = e->tv;
p.BackgroundColor = nil; // this is what Interface Builder sets it to
p.BackgroundColor = [NSColor colorWithCalibratedWhite:1.0 alpha:1.0];
p.DrawsBackground = YES; p.DrawsBackground = YES;
p.Bordered = YES; p.Bordered = YES;
p.HScroll = hscroll; p.HScroll = hscroll;

View File

@ -17,14 +17,13 @@ NSScrollView *mkScrollView(struct scrollViewCreateParams *p, struct scrollViewDa
struct scrollViewData *d; struct scrollViewData *d;
sv = [[NSScrollView alloc] initWithFrame:NSZeroRect]; sv = [[NSScrollView alloc] initWithFrame:NSZeroRect];
// TODO verify background color for programmatically created NSTextView
if (p->BackgroundColor != nil) if (p->BackgroundColor != nil)
[sv setBackgroundColor:p->BackgroundColor]; [sv setBackgroundColor:p->BackgroundColor];
[sv setDrawsBackground:p->DrawsBackground]; [sv setDrawsBackground:p->DrawsBackground];
border = NSNoBorder; border = NSNoBorder;
if (p->Bordered) if (p->Bordered)
border = NSBezelBorder; border = NSBezelBorder;
// TODO verify document cursor for programmatically created NSTextView // document view seems to set the cursor properly
[sv setBorderType:border]; [sv setBorderType:border];
[sv setAutohidesScrollers:YES]; [sv setAutohidesScrollers:YES];
[sv setHasHorizontalRuler:NO]; [sv setHasHorizontalRuler:NO];
@ -32,7 +31,7 @@ NSScrollView *mkScrollView(struct scrollViewCreateParams *p, struct scrollViewDa
[sv setRulersVisible:NO]; [sv setRulersVisible:NO];
[sv setScrollerKnobStyle:NSScrollerKnobStyleDefault]; [sv setScrollerKnobStyle:NSScrollerKnobStyleDefault];
// the scroller style is documented as being set by default for us // the scroller style is documented as being set by default for us
// TODO verify line and page for programmatically created NSTextView // LONGTERM verify line and page for programmatically created NSTableView
[sv setScrollsDynamically:YES]; [sv setScrollsDynamically:YES];
[sv setFindBarPosition:NSScrollViewFindBarPositionAboveContent]; [sv setFindBarPosition:NSScrollViewFindBarPositionAboveContent];
[sv setUsesPredominantAxisScrolling:NO]; [sv setUsesPredominantAxisScrolling:NO];