ui/cocoa/BoxContainer.m

Sun, 07 Dec 2025 20:00:33 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 07 Dec 2025 20:00:33 +0100
changeset 114
3da24640513a
parent 112
c3f2f16fa4b8
permissions
-rw-r--r--

fix settings dialog doesn't open when there is no .dav/config.xml file



#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  layout:(UiLayout*)layout {
    if(_orientation == NSUserInterfaceLayoutOrientationVertical) {
        layout->hexpand = TRUE;
        layout->hfill = TRUE;
    } else {
        layout->vexpand = TRUE;
        layout->vfill = TRUE;
    }
    [super addView:view layout:layout];
    if(_orientation == NSUserInterfaceLayoutOrientationVertical) {
        self.container->newline = TRUE;
    }
}

@end

mercurial