another textview/scrollview layout fix (Cocoa)

2 days ago

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 30 Mar 2025 17:06:27 +0200 (2 days ago)
changeset 540
d8b86f66721c
parent 539
96f466ceaf23
child 541
63289f61fb7f

another textview/scrollview layout fix (Cocoa)

ui/cocoa/text.m file | annotate | diff | comparison | revisions
--- a/ui/cocoa/text.m	Sun Mar 30 16:52:33 2025 +0200
+++ b/ui/cocoa/text.m	Sun Mar 30 17:06:27 2025 +0200
@@ -33,10 +33,11 @@
 
 UIWIDGET ui_textarea_create(UiObject *obj, UiTextAreaArgs args) {
     NSTextView *textview = [[NSTextView alloc] init];
-    textview.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
+    textview.autoresizingMask = NSViewWidthSizable;
+    textview.minSize = NSMakeSize(0, 0);
+    textview.maxSize = NSMakeSize(FLT_MAX, FLT_MAX);
     
     NSScrollView *scrollview = [[NSScrollView alloc] init];
-    scrollview.translatesAutoresizingMaskIntoConstraints = NO;
     scrollview.hasVerticalScroller = YES;
     scrollview.documentView = textview;
     

mercurial