Force tabViewType to be something we support. To be fixed in a later branch to add other renderings for tabview since this branch is specific to controllers

This commit is contained in:
Gregory John Casamento 2020-07-26 05:37:25 -04:00
parent 7bb2123da6
commit d41635855f
5 changed files with 18 additions and 4 deletions

View file

@ -2459,7 +2459,7 @@ typedef enum {
[self drawTabViewBezelRect: aRect
tabViewType: type
inView: view];
if (type == NSBottomTabsBezelBorder
|| type == NSTopTabsBezelBorder)
{

View file

@ -127,7 +127,6 @@
{
NSView *v = [_destinationController view];
NSSplitViewController *svc = (NSSplitViewController *)_sourceController;
[[svc splitView] adjustSubviews];
[[svc splitView] addSubview: v];
NSUInteger idx = [[[svc splitView] subviews] count] - 1;
NSSplitViewItem *item = [[svc splitViewItems] objectAtIndex: idx];

View file

@ -111,10 +111,15 @@
{
if (tabViewItem == nil)
return;
if (_items == nil)
{
ASSIGN(_items, [NSMutableArray array]);
}
[tabViewItem _setTabView: self];
[_items insertObject: tabViewItem atIndex: index];
// If this is the first inserted then select it...
if ([_items count] == 1)
[self selectTabViewItem: tabViewItem];
@ -564,7 +569,6 @@
{
ASSIGN(_items, [aDecoder decodeObjectForKey: @"NSTabViewItems"]);
[_items makeObjectsPerformSelector: @selector(_setTabView:) withObject: self];
}
if ([aDecoder containsValueForKey: @"NSSelectedTabViewItem"])
{

View file

@ -170,6 +170,16 @@
{
NSTabView *tv = [coder decodeObjectForKey: @"NSTabView"];
[self setTabView: tv];
// Currently we only support the tabs being on the top or the bottom.
// The rendering code doesn't support anything outside of these two
// cases. Here we force the use of the top case, when it is outside
// of either of the cases we handle... this is temporary. FIXME
if ([tv tabViewType] != NSTopTabsBezelBorder &&
[tv tabViewType] != NSBottomTabsBezelBorder)
{
[tv setTabViewType: NSTopTabsBezelBorder];
}
}
if ([coder containsValueForKey: @"NSTabViewItems"])
{

View file

@ -739,6 +739,7 @@ static NSNotificationCenter *nc = nil;
defer: NO];
[window setTitle: title];
[window setContentView: view];
[view setNeedsDisplay: YES];
AUTORELEASE(window);
return window;
}