ui/cocoa/text.m

changeset 110
c00e968d018b
parent 109
c3dfcb8f0be7
--- a/ui/cocoa/text.m	Sun Aug 24 15:24:16 2025 +0200
+++ b/ui/cocoa/text.m	Sat Oct 04 14:52:59 2025 +0200
@@ -182,7 +182,14 @@
         textfield = [[NSSecureTextField alloc] init];
     } else {
         textfield = [[NSTextField alloc] init];
-    } 
+    }
+    
+    if(!args->hfill || args->width > 0) {
+        textfield.translatesAutoresizingMaskIntoConstraints = NO;
+        int width = args->width > 0 ? args->width : 100;
+        [[textfield.widthAnchor constraintEqualToConstant:width] setActive:YES];
+    }
+    
     
     if(frameless) {
         [textfield setBezeled: NO];

mercurial