Show tabview properly

This commit is contained in:
Gregory John Casamento 2020-07-26 06:07:02 -04:00
parent d41635855f
commit e96106c295
2 changed files with 10 additions and 8 deletions

View file

@ -181,11 +181,6 @@
[tv setTabViewType: NSTopTabsBezelBorder];
}
}
if ([coder containsValueForKey: @"NSTabViewItems"])
{
NSArray *items = [coder decodeObjectForKey: @"NSTabViewItems"];
[self setTabViewItems: items];
}
}
return self;
}

View file

@ -86,10 +86,17 @@
+ (instancetype) tabViewItemWithViewController: (NSViewController *)vc
{
NSTabViewItem *item = [[NSTabViewItem alloc] init];
NSTabViewItem *item = AUTORELEASE([[NSTabViewItem alloc] init]);
if ([vc title] == nil || [[vc title] isEqualToString: @""])
{
NSString *className = [vc className];
[item setLabel: className];
}
else
{
[item setLabel: [vc title]];
}
[item setViewController: vc];
[item setLabel: [vc title]];
AUTORELEASE(item);
return item;
}