ui/cocoa/text.m

changeset 110
c00e968d018b
parent 109
c3dfcb8f0be7
equal deleted inserted replaced
109:c3dfcb8f0be7 110:c00e968d018b
180 NSTextField *textfield; 180 NSTextField *textfield;
181 if(password) { 181 if(password) {
182 textfield = [[NSSecureTextField alloc] init]; 182 textfield = [[NSSecureTextField alloc] init];
183 } else { 183 } else {
184 textfield = [[NSTextField alloc] init]; 184 textfield = [[NSTextField alloc] init];
185 } 185 }
186
187 if(!args->hfill || args->width > 0) {
188 textfield.translatesAutoresizingMaskIntoConstraints = NO;
189 int width = args->width > 0 ? args->width : 100;
190 [[textfield.widthAnchor constraintEqualToConstant:width] setActive:YES];
191 }
192
186 193
187 if(frameless) { 194 if(frameless) {
188 [textfield setBezeled: NO]; 195 [textfield setBezeled: NO];
189 } 196 }
190 197

mercurial