# HG changeset patch # User Olaf Wintermann # Date 1759403721 -7200 # Node ID 2fded949593049f234cee74c3721c19eecc8c754 # Parent 41286f7f8433958bc8cf621d694fc44e8033d391 set textfield width (Cocoa) diff -r 41286f7f8433 -r 2fded9495930 ui/cocoa/text.m --- a/ui/cocoa/text.m Sun Sep 07 11:57:01 2025 +0200 +++ b/ui/cocoa/text.m Thu Oct 02 13:15:21 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];