From cbb07113cad4f5f3fe45cfee46b1327c425a075c Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 22 Jun 2016 23:07:59 -0400 Subject: [PATCH] Fixed uiMultilineEntry to no longer use Auto Layout. --- darwin/multilineentry.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/darwin/multilineentry.m b/darwin/multilineentry.m index 3019c8b2..605e9004 100644 --- a/darwin/multilineentry.m +++ b/darwin/multilineentry.m @@ -184,12 +184,19 @@ static uiMultilineEntry *finishMultilineEntry(BOOL hscroll) // now just to be safe; this will do some of the above but whatever disableAutocorrect(e->tv); + // see https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TextUILayer/Tasks/TextInScrollView.html + // notice we don't use the Auto Layout code; see scrollview.m for more details + [e->tv setMaxSize:NSMakeSize(CGFLOAT_MAX, CGFLOAT_MAX)]; + [e->tv setVerticallyResizable:YES]; + [e->tv setHorizontallyResizable:hscroll]; if (hscroll) { - // see https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TextUILayer/Tasks/TextInScrollView.html - [e->tv setHorizontallyResizable:YES]; + [e->tv setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; [[e->tv textContainer] setWidthTracksTextView:NO]; - [[e->tv textContainer] setContainerSize:NSMakeSize(CGFLOAT_MAX, CGFLOAT_MAX)]; + } else { + [e->tv setAutoresizingMask:NSViewWidthSizable]; + [[e->tv textContainer] setWidthTracksTextView:YES]; } + [[e->tv textContainer] setContainerSize:NSMakeSize(CGFLOAT_MAX, CGFLOAT_MAX)]; // don't use uiDarwinSetControlFont() directly; we have to do a little extra work to set the font font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]];