diff --git a/src/MacVim/PSMTabBarControl/source/PSMAquaTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMAquaTabStyle.m index dba0250a98..a6c66a5195 100644 --- a/src/MacVim/PSMTabBarControl/source/PSMAquaTabStyle.m +++ b/src/MacVim/PSMTabBarControl/source/PSMAquaTabStyle.m @@ -418,6 +418,7 @@ labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; } +#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best. // icon if([cell hasIcon]){ NSRect iconRect = [self iconRectForTabCell:cell]; @@ -430,7 +431,8 @@ // scoot label over labelPosition += iconRect.size.width + kPSMTabBarCellPadding; } - +#endif + // object counter if([cell count] > 0){ [[NSColor colorWithCalibratedWhite:0.3 alpha:0.45] set]; @@ -451,8 +453,7 @@ counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; [counterString drawInRect:counterStringRect]; } - - + // label rect NSRect labelRect; labelRect.origin.x = labelPosition; diff --git a/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m index 31134804ec..bbc6b87085 100644 --- a/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m +++ b/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m @@ -402,7 +402,8 @@ void MyNSDrawWindowBackground(NSRect rect) // scoot label over labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; } - + +#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best. // icon if([cell hasIcon]){ NSRect iconRect = [self iconRectForTabCell:cell]; @@ -415,7 +416,8 @@ void MyNSDrawWindowBackground(NSRect rect) // scoot label over labelPosition += iconRect.size.width + kPSMTabBarCellPadding; } - +#endif + // object counter if([cell count] > 0){ [[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; @@ -438,7 +440,7 @@ void MyNSDrawWindowBackground(NSRect rect) counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; [counterString drawInRect:counterStringRect]; } - + // label rect NSRect labelRect; labelRect.origin.x = labelPosition; diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m index 7f1849c9c7..5b17c3cc08 100644 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m +++ b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m @@ -407,7 +407,7 @@ [[cell indicator] setHidden:YES]; if([item identifier] != nil){ if([[item identifier] respondsToSelector:@selector(content)]){ - if([[[[cell representedObject] identifier] content] respondsToSelector:@selector(isProcessing)]){ + if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(isProcessing)]){ NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary]; [bindingOptions setObject:NSNegateBooleanTransformerName forKey:@"NSValueTransformerName"]; [[cell indicator] bind:@"animate" toObject:[item identifier] withKeyPath:@"selection.isProcessing" options:nil]; @@ -421,7 +421,7 @@ [cell setHasIcon:NO]; if([item identifier] != nil){ if([[item identifier] respondsToSelector:@selector(content)]){ - if([[[[cell representedObject] identifier] content] respondsToSelector:@selector(icon)]){ + if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(icon)]){ NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary]; [bindingOptions setObject:NSIsNotNilTransformerName forKey:@"NSValueTransformerName"]; [cell bind:@"hasIcon" toObject:[item identifier] withKeyPath:@"selection.icon" options:bindingOptions]; @@ -434,7 +434,7 @@ [cell setCount:0]; if([item identifier] != nil){ if([[item identifier] respondsToSelector:@selector(content)]){ - if([[[[cell representedObject] identifier] content] respondsToSelector:@selector(objectCount)]){ + if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(objectCount)]){ [cell bind:@"count" toObject:[item identifier] withKeyPath:@"selection.objectCount" options:nil]; [[item identifier] addObserver:self forKeyPath:@"selection.objectCount" options:0 context:nil]; } diff --git a/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m index 2bd59762f8..6e778d9c2e 100644 --- a/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m +++ b/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m @@ -398,7 +398,8 @@ // scoot label over labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; } - + +#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best. // icon if([cell hasIcon]){ NSRect iconRect = [self iconRectForTabCell:cell]; @@ -411,7 +412,8 @@ // scoot label over labelPosition += iconRect.size.width + kPSMTabBarCellPadding; } - +#endif + // object counter if([cell count] > 0){ [[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; @@ -433,7 +435,7 @@ counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; [counterString drawInRect:counterStringRect]; } - + // label rect NSRect labelRect; labelRect.origin.x = labelPosition;