Sun, 05 Oct 2025 12:34:42 +0200
fix grid spacing (Cocoa)
#import "BoxContainer.h" @implementation BoxContainer - (BoxContainer*)init:(NSUserInterfaceLayoutOrientation)orientation spacing:(int)spacing { self = [super init]; _orientation = orientation; self.columnspacing = spacing; self.rowspacing = spacing; return self; } - (void) addView:(NSView*)view margin:(NSEdgeInsets)margin { UiLayout layout = self.uilayout; if(_orientation == NSUserInterfaceLayoutOrientationVertical) { layout.hexpand = TRUE; layout.hfill = TRUE; } else { layout.vexpand = TRUE; layout.vfill = TRUE; self.newline = FALSE; } self.uilayout = layout; [super addView:view margin:margin]; if(_orientation == NSUserInterfaceLayoutOrientationVertical) { self.newline = TRUE; } } @end