diff options
23 files changed, 299 insertions, 4065 deletions
diff --git a/Frameworks/PSMTabBar/PSMRolloverButton.h b/Frameworks/PSMTabBar/PSMRolloverButton.h index 9f339a50..5a2ac368 100644 --- a/Frameworks/PSMTabBar/PSMRolloverButton.h +++ b/Frameworks/PSMTabBar/PSMRolloverButton.h @@ -24,11 +24,11 @@ - (nullable NSImage *)rolloverImage; // tracking rect for mouse events -- (void)rolloverFrameDidChange:(nonnull NSNotification *)inNotification; +- (void)rolloverFrameDidChange:(nonnull NSNotification *)notification; - (void)addTrackingRect; - (void)removeTrackingRect; -- (void)mouseEntered:(nullable NSEvent *)theEvent; -- (void)mouseExited:(nullable NSEvent *)theEvent; +- (void)mouseEntered:(nullable NSEvent *)event; +- (void)mouseExited:(nullable NSEvent *)event; @end diff --git a/Frameworks/PSMTabBar/PSMRolloverButton.m b/Frameworks/PSMTabBar/PSMRolloverButton.m index 4ded63b7..730caec0 100644 --- a/Frameworks/PSMTabBar/PSMRolloverButton.m +++ b/Frameworks/PSMTabBar/PSMRolloverButton.m @@ -20,6 +20,7 @@ selector:@selector(rolloverFrameDidChange:) name:NSViewFrameDidChangeNotification object:self]; + [self setPostsFrameChangedNotifications:YES]; [self resetCursorRects]; @@ -28,17 +29,6 @@ _usualImage = nil; } -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [self removeTrackingRect]; - [_rolloverImage release]; - [_usualImage release]; - - [super dealloc]; -} - // the regular image - (void)setUsualImage:(NSImage *)newImage { @@ -66,7 +56,7 @@ return _rolloverImage; } -//Remove old tracking rects when we change superviews +// Remove old tracking rects when we change superviews - (void)viewWillMoveToSuperview:(NSView *)newSuperview { [self removeTrackingRect]; @@ -95,7 +85,7 @@ [self resetCursorRects]; } -- (void)rolloverFrameDidChange:(NSNotification *)inNotification +- (void)rolloverFrameDidChange:(NSNotification *)notification { [self resetCursorRects]; } @@ -104,15 +94,18 @@ { // assign a tracking rect to watch for mouse enter/exit NSRect trackRect = [self bounds]; - NSPoint localPoint = [self convertPoint:[[self window] convertScreenToBase:[NSEvent mouseLocation]] - fromView:nil]; - BOOL mouseInside = NSPointInRect(localPoint, trackRect); + NSPoint localPoint = [self convertPoint:[[self window] convertScreenToBase:[NSEvent mouseLocation]] fromView:nil]; + + BOOL mouseInside = NSPointInRect(localPoint, trackRect); _myTrackingRectTag = [self addTrackingRect:trackRect owner:self userData:nil assumeInside:mouseInside]; - if (mouseInside) + + if (mouseInside) { [self mouseEntered:nil]; - else + } + else { [self mouseExited:nil]; + } } - (void)removeTrackingRect @@ -120,24 +113,27 @@ if (_myTrackingRectTag != -1) { [self removeTrackingRect:_myTrackingRectTag]; } + _myTrackingRectTag = -1; } // override for rollover effect -- (void)mouseEntered:(nullable NSEvent *)theEvent +- (void)mouseEntered:(nullable NSEvent *)event { // set rollover image [self setImage:_rolloverImage]; - [super mouseEntered:theEvent]; + [super mouseEntered:event]; } -- (void)mouseExited:(nullable NSEvent *)theEvent +- (void)mouseExited:(nullable NSEvent *)event { // restore usual image [self setImage:_usualImage]; - [super mouseExited:theEvent]; + [self setHighlighted:NO]; + + [super mouseExited:event]; } - (void)resetCursorRects @@ -162,26 +158,42 @@ #pragma mark - #pragma mark Archiving -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:_rolloverImage forKey:@"rolloverImage"]; - [aCoder encodeObject:_usualImage forKey:@"usualImage"]; - [aCoder encodeInteger:_myTrackingRectTag forKey:@"myTrackingRectTag"]; +- (void)encodeWithCoder:(NSCoder *)coder +{ + [super encodeWithCoder:coder]; + + if ([coder allowsKeyedCoding]) { + [coder encodeObject:_rolloverImage forKey:@"rolloverImage"]; + [coder encodeObject:_usualImage forKey:@"usualImage"]; + [coder encodeInteger:_myTrackingRectTag forKey:@"myTrackingRectTag"]; } } -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self) { - if ([aDecoder allowsKeyedCoding]) { - _rolloverImage = [[aDecoder decodeObjectForKey:@"rolloverImage"] retain]; - _usualImage = [[aDecoder decodeObjectForKey:@"usualImage"] retain]; - _myTrackingRectTag = [aDecoder decodeIntegerForKey:@"myTrackingRectTag"]; +- (id)initWithCoder:(NSCoder *)decoder +{ + if ((self = [super initWithCoder:decoder])) { + if ([decoder allowsKeyedCoding]) { + _rolloverImage = [[decoder decodeObjectForKey:@"rolloverImage"] retain]; + _usualImage = [[decoder decodeObjectForKey:@"usualImage"] retain]; + _myTrackingRectTag = [decoder decodeIntegerForKey:@"myTrackingRectTag"]; } } + return self; } +#pragma mark - + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [self removeTrackingRect]; + + [_rolloverImage release]; + [_usualImage release]; + + [super dealloc]; +} @end diff --git a/Frameworks/PSMTabBar/PSMTabBarCell.m b/Frameworks/PSMTabBar/PSMTabBarCell.m index 80fe4ec0..fb869f47 100644 --- a/Frameworks/PSMTabBar/PSMTabBarCell.m +++ b/Frameworks/PSMTabBar/PSMTabBarCell.m @@ -432,8 +432,11 @@ [image lockFocusFlipped:YES]; #endif [self setFrame:tabDrawFrame]; - [(id <PSMTabStyle>)[(PSMTabBarControl *)_customControlView style] drawTabCell:self]; + + [(id <PSMTabStyle>)[(PSMTabBarControl *)_customControlView style] drawTabCellForDragImage:self]; + [self setFrame:oldFrame]; + [image unlockFocus]; // Add the indicator if appropriate diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.h b/Frameworks/PSMTabBar/PSMTabBarControl.h index ad9de748..dee4ed8a 100644 --- a/Frameworks/PSMTabBar/PSMTabBarControl.h +++ b/Frameworks/PSMTabBar/PSMTabBarControl.h @@ -15,13 +15,16 @@ #define PSMTabDragDidEndNotification @"PSMTabDragDidEndNotification" #define PSMTabDragDidBeginNotification @"PSMTabDragDidBeginNotification" -#define kPSMTabBarControlHeight 34 +#define kPSMTabBarControlHeight 25 #define kPSMTabBarControlDefaultHeightCollapsed 0 // can be changed with a property + // internal cell border #define MARGIN_X 6 -#define MARGIN_Y 5 +#define MARGIN_Y 6 + // padding between objects #define kPSMTabBarCellPadding 4 + // fixed size objects #define kPSMMinimumTitleWidth 30 #define kPSMTabBarIndicatorWidth 16.0f @@ -48,13 +51,13 @@ typedef enum { } PSMTabBarTearOffStyle; enum { - PSMTab_SelectedMask = 1 << 1, - PSMTab_LeftIsSelectedMask = 1 << 2, - PSMTab_RightIsSelectedMask = 1 << 3, + PSMTab_SelectedMask = 1 << 1, + PSMTab_LeftIsSelectedMask = 1 << 2, + PSMTab_RightIsSelectedMask = 1 << 3, PSMTab_PositionLeftMask = 1 << 4, - PSMTab_PositionMiddleMask = 1 << 5, - PSMTab_PositionRightMask = 1 << 6, - PSMTab_PositionSingleMask = 1 << 7 + PSMTab_PositionMiddleMask = 1 << 5, + PSMTab_PositionRightMask = 1 << 6, + PSMTab_PositionSingleMask = 1 << 7 }; @interface PSMTabBarControl : NSControl { diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m index 18b5a296..3e3c1e30 100644 --- a/Frameworks/PSMTabBar/PSMTabBarControl.m +++ b/Frameworks/PSMTabBar/PSMTabBarControl.m @@ -11,11 +11,6 @@ #import "PSMOverflowPopUpButton.h" #import "PSMRolloverButton.h" #import "PSMTabStyle.h" -#import "PSMMetalTabStyle.h" -#import "PSMAquaTabStyle.h" -#import "PSMUnifiedTabStyle.h" -#import "PSMCardTabStyle.h" -#import "PSMAdiumTabStyle.h" #import "PSMSequelProTabStyle.h" #import "PSMTabDragAssistant.h" #import "PSMTabBarController.h" @@ -161,6 +156,7 @@ // new tab button NSRect addTabButtonRect = NSMakeRect([self frame].size.width - [style rightMarginForTabBarControl] + 1, 3.0f, 16.0f, 16.0f); _addTabButton = [[PSMRolloverButton alloc] initWithFrame:addTabButtonRect]; + if (_addTabButton) { NSImage *newButtonImage = [style addTabButtonImage]; if (newButtonImage) { @@ -369,31 +365,16 @@ - (void)setStyleNamed:(NSString *)name { id <PSMTabStyle> newStyle; - -/* if ([name isEqualToString:@"Aqua"]) { - newStyle = [[PSMAquaTabStyle alloc] init]; - - } else if ([name isEqualToString:@"Unified"]) { - newStyle = [[PSMUnifiedTabStyle alloc] init]; - - } else if ([name isEqualToString:@"Adium"]) { - newStyle = [[PSMAdiumTabStyle alloc] init]; - - } else if ([name isEqualToString:@"Card"]) { - newStyle = [[PSMCardTabStyle alloc] init]; - - } else if ([name isEqualToString:@"Metal"]) { - newStyle = [[PSMMetalTabStyle alloc] init]; - } else */ if ([name isEqualToString:@"SequelPro"]) { newStyle = [[PSMSequelProTabStyle alloc] init]; - - } else { + } + else { newStyle = [[PSMSequelProTabStyle alloc] init]; } [self setStyle:newStyle]; + [newStyle release]; } diff --git a/Frameworks/PSMTabBar/PSMTabBarController.m b/Frameworks/PSMTabBar/PSMTabBarController.m index eddf4174..53f11c63 100644 --- a/Frameworks/PSMTabBar/PSMTabBarController.m +++ b/Frameworks/PSMTabBar/PSMTabBarController.m @@ -214,7 +214,7 @@ _addButtonRect.size = [[_control addTabButton] frame].size; if ([_control orientation] == PSMTabBarHorizontalOrientation) { _addButtonRect.origin.y = MARGIN_Y; - _addButtonRect.origin.x += [[cellWidths valueForKeyPath:@"@sum.floatValue"] floatValue] + MARGIN_X; + _addButtonRect.origin.x += [[cellWidths valueForKeyPath:@"@sum.floatValue"] floatValue] + MARGIN_X; } else { _addButtonRect.origin.x = 0; _addButtonRect.origin.y = [[cellWidths lastObject] floatValue]; diff --git a/Frameworks/PSMTabBar/PSMTabDragView.m b/Frameworks/PSMTabBar/PSMTabDragView.m index 5be56b10..aa066d86 100644 --- a/Frameworks/PSMTabBar/PSMTabDragView.m +++ b/Frameworks/PSMTabBar/PSMTabDragView.m @@ -34,7 +34,9 @@ srcRect.size = [_image size]; [_image drawInRect:[self bounds] fromRect:srcRect operation:NSCompositeSourceOver fraction:primaryAlpha]; + srcRect.size = [_alternateImage size]; + [_alternateImage drawInRect:[self bounds] fromRect:srcRect operation:NSCompositeSourceOver fraction:alternateAlpha]; } diff --git a/Frameworks/PSMTabBar/PSMTabStyle.h b/Frameworks/PSMTabBar/PSMTabStyle.h index 23c826fa..0688c8a9 100644 --- a/Frameworks/PSMTabBar/PSMTabStyle.h +++ b/Frameworks/PSMTabBar/PSMTabStyle.h @@ -7,8 +7,10 @@ // /* -Protocol to be observed by all style delegate objects. These objects handle the drawing responsibilities for PSMTabBarCell; once the control has been assigned a style, the background and cells draw consistent with that style. Design pattern and implementation by David Smith, Seth Willits, and Chris Forsythe, all touch up and errors by John P. :-) -*/ + * Protocol to be observed by all style delegate objects. + * These objects handle the drawing responsibilities for PSMTabBarCell; once the control has been assigned a style, the background and cells draw consistent with that style. + * Design pattern and implementation by David Smith, Seth Willits, and Chris Forsythe, all touch up and errors by John P. :-) + */ #import "PSMTabBarCell.h" #import "PSMTabBarControl.h" @@ -45,6 +47,7 @@ Protocol to be observed by all style delegate objects. These objects handle the // drawing - (void)drawTabCell:(PSMTabBarCell *)cell; +- (void)drawTabCellForDragImage:(PSMTabBarCell *)cell; - (void)drawBackgroundInRect:(NSRect)rect; - (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect; diff --git a/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.h b/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.h deleted file mode 100644 index fac9a427..00000000 --- a/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// PSMAdiumTabStyle.h -// PSMTabBarControl -// -// Created by Kent Sutherland on 5/26/06. -// Copyright 2006 Kent Sutherland. All rights reserved. -// - -#import <Cocoa/Cocoa.h> -#import "PSMTabStyle.h" - -@interface PSMAdiumTabStyle : NSObject <PSMTabStyle> -{ - NSImage *_closeButton, *_closeButtonDown, *_closeButtonOver; - NSImage *_closeDirtyButton, *_closeDirtyButtonDown, *_closeDirtyButtonOver; - NSImage *_addTabButtonImage, *_addTabButtonPressedImage, *_addTabButtonRolloverImage; - NSImage *_gradientImage; - - NSDictionary *_objectCountStringAttributes; - - PSMTabBarOrientation orientation; - PSMTabBarControl *tabBar; - - BOOL _drawsUnified, _drawsRight; -} - -- (void)loadImages; - -- (BOOL)drawsUnified; -- (void)setDrawsUnified:(BOOL)value; -- (BOOL)drawsRight; -- (void)setDrawsRight:(BOOL)value; - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; - -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - -@end diff --git a/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m deleted file mode 100644 index be14707d..00000000 --- a/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m +++ /dev/null @@ -1,1050 +0,0 @@ -// -// PSMAdiumTabStyle.m -// PSMTabBarControl -// -// Created by Kent Sutherland on 5/26/06. -// Copyright 2006 Kent Sutherland. All rights reserved. -// - -#import "PSMAdiumTabStyle.h" -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" -#import "NSBezierPath_AMShading.h" - -#define Adium_CellPadding 2 -#define Adium_MARGIN_X 4 -#define kPSMAdiumCounterPadding 3.0 -#define kPSMAdiumObjectCounterRadius 7.0 -#define kPSMAdiumCounterMinWidth 20 - -#define kPSMTabBarControlSourceListHeight 28 - -#define kPSMTabBarLargeImageHeight kPSMTabBarControlSourceListHeight - 4 -#define kPSMTabBarLargeImageWidth kPSMTabBarLargeImageHeight - -@implementation PSMAdiumTabStyle - -- (NSString *)name -{ - return @"Adium"; -} - -#pragma mark - -#pragma mark Creation/Destruction - -- (id)init -{ - if ( (self = [super init]) ) { - [self loadImages]; - _drawsUnified = NO; - _drawsRight = NO; - - _objectCountStringAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:[[NSFontManager sharedFontManager] convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask], NSFontAttributeName, - [[NSColor whiteColor] colorWithAlphaComponent:0.85], NSForegroundColorAttributeName, - nil, nil]; - } - return self; -} - -- (void)loadImages -{ - _closeButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front"]]; - _closeButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Pressed"]]; - _closeButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Rollover"]]; - - _closeDirtyButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front"]]; - _closeDirtyButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front_Pressed"]]; - _closeDirtyButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNew"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewRollover"]]; - - _gradientImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AdiumGradient"]]; -} - -- (void)dealloc -{ - [_closeButton release]; - [_closeButtonDown release]; - [_closeButtonOver release]; - - [_closeDirtyButton release]; - [_closeDirtyButtonDown release]; - [_closeDirtyButtonOver release]; - - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - - [_gradientImage release]; - - [_objectCountStringAttributes release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Drawing Style Accessors - -- (BOOL)drawsUnified -{ - return _drawsUnified; -} - -- (void)setDrawsUnified:(BOOL)value -{ - _drawsUnified = value; -} - -- (BOOL)drawsRight -{ - return _drawsRight; -} - -- (void)setDrawsRight:(BOOL)value -{ - _drawsRight = value; -} - -#pragma mark - -#pragma mark Control Specific - -- (CGFloat)leftMarginForTabBarControl -{ - return 3.0f; -} - -- (CGFloat)rightMarginForTabBarControl -{ - return 24.0f; -} - -- (CGFloat)topMarginForTabBarControl -{ - return 10.0f; -} - -- (void)setOrientation:(PSMTabBarOrientation)value -{ - orientation = value; -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect)dragRectForTabCell:(PSMTabBarCell *)cell orientation:(PSMTabBarOrientation)tabOrientation -{ - NSRect dragRect = [cell frame]; - - if ([cell tabState] & PSMTab_SelectedMask) { - if (tabOrientation == PSMTabBarHorizontalOrientation) { - dragRect.size.width++; - dragRect.size.height -= 2.0; - } - } - - return dragRect; -} - -- (BOOL)closeButtonIsEnabledForCell:(PSMTabBarCell *)cell -{ - return ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]); - -} -- (NSRect)closeButtonRectForTabCell:(PSMTabBarCell *)cell withFrame:(NSRect)cellFrame -{ - if ([self closeButtonIsEnabledForCell:cell] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [_closeButton size]; - - switch (orientation) { - case PSMTabBarHorizontalOrientation: - { - result.origin.x = cellFrame.origin.x + Adium_MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 2.0; - if ([cell state] == NSOnState) { - result.origin.y -= 1; - } - break; - } - - case PSMTabBarVerticalOrientation: - { - result.origin.x = NSMaxX(cellFrame) - (Adium_MARGIN_X*2) - NSWidth(result); - result.origin.y = NSMinY(cellFrame) + (NSHeight(cellFrame) / 2) - (result.size.height / 2) + 1; - break; - } - } - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect cellFrame = [cell frame]; - NSImage *icon = [[[cell representedObject] identifier] icon]; - NSSize iconSize = [icon size]; - - NSRect result; - result.size = iconSize; - - switch (orientation) - { - case PSMTabBarHorizontalOrientation: - result.origin.x = cellFrame.origin.x + Adium_MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - break; - - case PSMTabBarVerticalOrientation: - result.origin.x = NSMaxX(cellFrame) - (Adium_MARGIN_X * 2) - NSWidth(result); - result.origin.y = NSMinY(cellFrame) + (NSHeight(cellFrame) / 2) - (NSHeight(result) / 2) + 1; - break; - } - - // For horizontal tabs, center in available space (in case icon image is smaller than kPSMTabBarIconWidth) - if (orientation == PSMTabBarHorizontalOrientation) { - if (iconSize.width < kPSMTabBarIconWidth) - result.origin.x += (kPSMTabBarIconWidth - iconSize.width) / 2.0; - if (iconSize.height < kPSMTabBarIconWidth) - result.origin.y += (kPSMTabBarIconWidth - iconSize.height) / 2.0; - } - - if ([cell state] == NSOnState) { - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - Adium_MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if ([cell state] == NSOnState) { - result.origin.y -= 1; - } - - return result; -} - -- (NSSize)sizeForObjectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSSize size; - CGFloat countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - - countWidth += (2 * kPSMAdiumObjectCounterRadius - 6.0 + kPSMAdiumCounterPadding); - - if (countWidth < kPSMAdiumCounterMinWidth) { - countWidth = kPSMAdiumCounterMinWidth; - } - - size = NSMakeSize(countWidth, 2 * kPSMAdiumObjectCounterRadius); // temp - - return size; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame; - NSRect result; - - if ([cell count] == 0) { - return NSZeroRect; - } - - cellFrame = [cell frame]; - result.size = [self sizeForObjectCounterRectForTabCell:cell]; - result.origin.x = NSMaxX(cellFrame) - Adium_MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if (![[cell indicator] isHidden]) { - result.origin.x -= kPSMTabBarIndicatorWidth + Adium_CellPadding; - } - - return result; -} - -- (CGFloat)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - CGFloat resultWidth = 0.0; - - // left margin - resultWidth = Adium_MARGIN_X; - - // close button? - if ([self closeButtonIsEnabledForCell:cell]) { - resultWidth += MAX([_closeButton size].width, NSWidth([self iconRectForTabCell:cell])) + Adium_CellPadding; - } - - // icon? - /*if ([cell hasIcon]) { - resultWidth += kPSMTabBarIconWidth + Adium_CellPadding; - }*/ - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if (([cell count] > 0) && (orientation == PSMTabBarHorizontalOrientation)) { - resultWidth += NSWidth([self objectCounterRectForTabCell:cell]) + Adium_CellPadding; - } - - // indicator? - if ([[cell indicator] isHidden] == NO) { - resultWidth += Adium_CellPadding + kPSMTabBarIndicatorWidth; - } - - // right margin - resultWidth += Adium_MARGIN_X; - - return ceil(resultWidth); -} - -- (CGFloat)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - CGFloat resultWidth = 0.0; - - // left margin - resultWidth = Adium_MARGIN_X; - - // close button? - if ([self closeButtonIsEnabledForCell:cell]) { - resultWidth += MAX([_closeButton size].width, NSWidth([self iconRectForTabCell:cell])) + Adium_CellPadding; - } - - // icon? - /*if ([cell hasIcon]) { - resultWidth += kPSMTabBarIconWidth + Adium_CellPadding; - }*/ - - // the label - resultWidth += [[cell attributedStringValue] size].width + Adium_CellPadding; - - // object counter? - if (([cell count] > 0) && (orientation == PSMTabBarHorizontalOrientation)){ - resultWidth += [self objectCounterRectForTabCell:cell].size.width + Adium_CellPadding; - } - - // indicator? - if ([[cell indicator] isHidden] == NO) { - resultWidth += Adium_CellPadding + kPSMTabBarIndicatorWidth; - } - - // right margin - resultWidth += Adium_MARGIN_X; - - return ceil(resultWidth); -} - -- (CGFloat)tabCellHeight -{ - return ((orientation == PSMTabBarHorizontalOrientation) ? kPSMTabBarControlHeight : kPSMTabBarControlSourceListHeight); -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSString *contents = [NSString stringWithFormat:@"%lu", (unsigned long)[cell count]]; - return [[[NSMutableAttributedString alloc] initWithString:contents attributes:_objectCountStringAttributes] autorelease]; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString *contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[NSColor controlTextColor] range:range]; - - // Paragraph Style for Truncating Long Text - static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; - if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:TruncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark Cell Drawing - -- (CGFloat)heightOfAttributedString:(NSAttributedString *)inAttributedString withWidth:(CGFloat)width -{ - static NSMutableDictionary *cache; - if (!cache) - cache = [[NSMutableDictionary alloc] init]; - if ([cache count] > 100) //100 items should be trivial in terms of memory overhead, but sufficient - [cache removeAllObjects]; - NSNumber *cachedHeight = [cache objectForKey:inAttributedString]; - if (cachedHeight) - return [cachedHeight doubleValue]; - else { - NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:inAttributedString]; - NSTextContainer *textContainer = [[NSTextContainer alloc] initWithContainerSize:NSMakeSize(width, 1e7)]; - NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init]; - - //Configure - [textContainer setLineFragmentPadding:0.0]; - [layoutManager addTextContainer:textContainer]; - [textStorage addLayoutManager:layoutManager]; - - //Force the layout manager to layout its text - (void)[layoutManager glyphRangeForTextContainer:textContainer]; - - CGFloat height = [layoutManager usedRectForTextContainer:textContainer].size.height; - - [textStorage release]; - [textContainer release]; - [layoutManager release]; - - [cache setObject:[NSNumber numberWithDouble:height] forKey:inAttributedString]; - - return height; - } -} - -- (void)drawObjectCounterInCell:(PSMTabBarCell *)cell withRect:(NSRect)myRect -{ - myRect.size.width -= kPSMAdiumCounterPadding; - myRect.origin.x += kPSMAdiumCounterPadding; - - [[cell countColor] ?: [NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - [path setLineWidth:1.0]; - - if ([cell state] == NSOnState) { - myRect.origin.y -= 1.0; - } - - [path moveToPoint:NSMakePoint(NSMinX(myRect) + kPSMAdiumObjectCounterRadius, NSMinY(myRect))]; - [path lineToPoint:NSMakePoint(NSMaxX(myRect) - kPSMAdiumObjectCounterRadius, NSMinY(myRect))]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(myRect) - kPSMAdiumObjectCounterRadius, NSMinY(myRect) + kPSMAdiumObjectCounterRadius) - radius:kPSMAdiumObjectCounterRadius - startAngle:270.0 - endAngle:90.0]; - [path lineToPoint:NSMakePoint(NSMinX(myRect) + kPSMAdiumObjectCounterRadius, NSMaxY(myRect))]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(myRect) + kPSMAdiumObjectCounterRadius, NSMinY(myRect) + kPSMAdiumObjectCounterRadius) - radius:kPSMAdiumObjectCounterRadius - startAngle:90.0 - endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; -} - -- (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect radius:(CGFloat)radius -{ - NSBezierPath *path = [NSBezierPath bezierPath]; - NSPoint topLeft, topRight, bottomLeft, bottomRight; - - topLeft = NSMakePoint(rect.origin.x, rect.origin.y); - topRight = NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y); - bottomLeft = NSMakePoint(rect.origin.x, rect.origin.y + rect.size.height); - bottomRight = NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height); - - [path appendBezierPathWithArcWithCenter:NSMakePoint(topLeft.x + radius, topLeft.y + radius) - radius:radius - startAngle:180 - endAngle:270 - clockwise:NO]; - [path lineToPoint:NSMakePoint(topRight.x - radius, topRight.y)]; - - [path appendBezierPathWithArcWithCenter:NSMakePoint(topRight.x - radius, topRight.y + radius) - radius:radius - startAngle:270 - endAngle:0 - clockwise:NO]; - [path lineToPoint:NSMakePoint(bottomRight.x, bottomRight.y - radius)]; - - [path appendBezierPathWithArcWithCenter:NSMakePoint(bottomRight.x - radius, bottomRight.y - radius) - radius:radius - startAngle:0 - endAngle:90 - clockwise:NO]; - [path lineToPoint:NSMakePoint(bottomLeft.x + radius, bottomLeft.y)]; - - [path appendBezierPathWithArcWithCenter:NSMakePoint(bottomLeft.x + radius, bottomLeft.y - radius) - radius:radius - startAngle:90 - endAngle:180 - clockwise:NO]; - [path lineToPoint:NSMakePoint(topLeft.x, topLeft.y + radius)]; - - return path; -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - - if ((orientation == PSMTabBarVerticalOrientation) && - [cell hasLargeImage]) { - NSImage *image = [[[cell representedObject] identifier] largeImage]; - cellFrame.origin.x += Adium_MARGIN_X; - - NSRect imageDrawingRect = NSMakeRect(cellFrame.origin.x, - cellFrame.origin.y - ((kPSMTabBarControlSourceListHeight - kPSMTabBarLargeImageHeight) / 2), - kPSMTabBarLargeImageWidth, kPSMTabBarLargeImageHeight); - - [NSGraphicsContext saveGraphicsState]; - //Use a transform to draw an arbitrary image in our flipped view - NSAffineTransform *transform = [NSAffineTransform transform]; - [transform translateXBy:imageDrawingRect.origin.x yBy:(imageDrawingRect.origin.y + imageDrawingRect.size.height)]; - [transform scaleXBy:1.0 yBy:-1.0]; - [transform concat]; - - imageDrawingRect.origin = NSMakePoint(0,0); - - //Create Rounding. - CGFloat userIconRoundingRadius = (kPSMTabBarLargeImageWidth / 4.0); - if (userIconRoundingRadius > 3) userIconRoundingRadius = 3; - NSBezierPath *clipPath = [self bezierPathWithRoundedRect:imageDrawingRect radius:userIconRoundingRadius]; - [clipPath addClip]; - - [image drawInRect:imageDrawingRect - fromRect:NSMakeRect(0, 0, [image size].width, [image size].height) - operation:NSCompositeSourceOver - fraction:1.0]; - - [NSGraphicsContext restoreGraphicsState]; - - cellFrame.origin.x += imageDrawingRect.size.width; - cellFrame.size.width -= imageDrawingRect.size.width; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = cellFrame.origin.x + Adium_MARGIN_X; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - Adium_CellPadding; - labelRect.size.height = cellFrame.size.height; - switch (orientation) - { - case PSMTabBarHorizontalOrientation: - labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - break; - case PSMTabBarVerticalOrientation: - labelRect.origin.y = cellFrame.origin.y; - break; - } - - if ([self closeButtonIsEnabledForCell:cell]) { - /* The close button and the icon (if present) are drawn combined, changing on-hover */ - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSRect iconRect = [self iconRectForTabCell:cell]; - NSRect drawingRect; - NSImage *closeButtonOrIcon = nil; - - if ([cell hasIcon]) { - /* If the cell has an icon and a close button, determine which rect should be used and use it consistently - * This only matters for horizontal tabs; vertical tabs look fine without making this adjustment. - */ - if (NSWidth(iconRect) > NSWidth(closeButtonRect)) { - closeButtonRect.origin.x = NSMinX(iconRect) + NSWidth(iconRect)/2 - NSWidth(closeButtonRect)/2; - } - } - - if ([cell closeButtonPressed]) { - closeButtonOrIcon = ([cell isEdited] ? _closeDirtyButtonDown : _closeButtonDown); - drawingRect = closeButtonRect; - - } else if ([cell closeButtonOver]) { - closeButtonOrIcon = ([cell isEdited] ? _closeDirtyButtonOver : _closeButtonOver); - drawingRect = closeButtonRect; - - } else if ((orientation == PSMTabBarVerticalOrientation) && - ([cell count] > 0)) { - /* In vertical tabs, the count indicator supercedes the icon */ - NSSize counterSize = [self sizeForObjectCounterRectForTabCell:cell]; - if (counterSize.width > NSWidth(closeButtonRect)) { - closeButtonRect.origin.x -= (counterSize.width - NSWidth(closeButtonRect)); - closeButtonRect.size.width = counterSize.width; - } - - closeButtonRect.origin.y = cellFrame.origin.y + ((NSHeight(cellFrame) - counterSize.height) / 2); - closeButtonRect.size.height = counterSize.height; - - drawingRect = closeButtonRect; - [self drawObjectCounterInCell:cell withRect:drawingRect]; - /* closeButtonOrIcon == nil */ - - } else if ([cell hasIcon]) { - closeButtonOrIcon = [[[cell representedObject] identifier] icon]; - drawingRect = iconRect; - - } else { - closeButtonOrIcon = ([cell isEdited] ? _closeDirtyButton : _closeButton); - drawingRect = closeButtonRect; - } - - [closeButtonOrIcon drawInRect:drawingRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - - // scoot label over - switch (orientation) - { - case PSMTabBarHorizontalOrientation: - { - CGFloat oldOrigin = labelRect.origin.x; - if (NSWidth(iconRect) > NSWidth(closeButtonRect)) { - labelRect.origin.x = (NSMaxX(iconRect) + (Adium_CellPadding * 2)); - } else { - labelRect.origin.x = (NSMaxX(closeButtonRect) + (Adium_CellPadding * 2)); - } - labelRect.size.width -= (NSMinX(labelRect) - oldOrigin); - break; - } - case PSMTabBarVerticalOrientation: - { - //Generate the remaining label rect directly from the location of the close button, allowing for padding - if (NSWidth(iconRect) > NSWidth(closeButtonRect)) { - labelRect.size.width = NSMinX(iconRect) - Adium_CellPadding - NSMinX(labelRect); - } else { - labelRect.size.width = NSMinX(closeButtonRect) - Adium_CellPadding - NSMinX(labelRect); - } - - break; - } - } - - } else if ([cell hasIcon]) { - /* The close button is disabled; the cell has an icon */ - NSRect iconRect = [self iconRectForTabCell:cell]; - NSImage *icon = [[[cell representedObject] identifier] icon]; - - [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - - // scoot label over by the size of the standard close button - switch (orientation) - { - case PSMTabBarHorizontalOrientation: - labelRect.origin.x += (NSWidth(iconRect) + Adium_CellPadding); - labelRect.size.width -= (NSWidth(iconRect) + Adium_CellPadding); - break; - case PSMTabBarVerticalOrientation: - labelRect.size.width -= (NSWidth(iconRect) + Adium_CellPadding); - break; - } - } - - if ([cell state] == NSOnState) { - labelRect.origin.y -= 1; - } - - if (![[cell indicator] isHidden]) { - labelRect.size.width -= (kPSMTabBarIndicatorWidth + Adium_CellPadding); - } - - // object counter - //The object counter takes up space horizontally... - if (([cell count] > 0) && - (orientation == PSMTabBarHorizontalOrientation)) { - NSRect counterRect = [self objectCounterRectForTabCell:cell]; - - [self drawObjectCounterInCell:cell withRect:counterRect]; - labelRect.size.width -= NSWidth(counterRect) + Adium_CellPadding; - } - - // draw label - NSAttributedString *attributedString = [cell attributedStringValue]; - if (orientation == PSMTabBarVerticalOrientation) { - //Calculate the centered rect - CGFloat stringHeight = [self heightOfAttributedString:attributedString withWidth:NSWidth(labelRect)]; - if (stringHeight < labelRect.size.height) { - labelRect.origin.y += (NSHeight(labelRect) - stringHeight) / 2.0; - } - } - - [attributedString drawInRect:labelRect]; -} - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - NSColor *lineColor = nil; - NSBezierPath *bezier = [NSBezierPath bezierPath]; - lineColor = [NSColor grayColor]; - - [bezier setLineWidth:1.0]; - - //disable antialiasing of bezier paths - [NSGraphicsContext saveGraphicsState]; - [[NSGraphicsContext currentContext] setShouldAntialias:NO]; - - NSShadow *shadow = [[NSShadow alloc] init]; - [shadow setShadowOffset:NSMakeSize(-2, -2)]; - [shadow setShadowBlurRadius:2]; - [shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.6 alpha:1.0]]; - - if ([cell state] == NSOnState) { - // selected tab - if (orientation == PSMTabBarHorizontalOrientation) { - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, NSWidth(cellFrame), cellFrame.size.height - 2.5); - - // background - if (_drawsUnified) { - if ([[[tabBar tabView] window] isKeyWindow]) { - NSBezierPath *path = [NSBezierPath bezierPathWithRect:aRect]; - [path linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]]; - } else { - [[NSColor windowBackgroundColor] set]; - NSRectFill(aRect); - } - } else { - [_gradientImage drawInRect:NSMakeRect(NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)) fromRect:NSMakeRect(0, 0, [_gradientImage size].width, [_gradientImage size].height) operation:NSCompositeSourceOver fraction:1.0]; - } - - // frame - [lineColor set]; - [bezier setLineWidth:1.0]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y + aRect.size.height)]; - - [shadow setShadowOffset:NSMakeSize(-2, -2)]; - [shadow set]; - [bezier stroke]; - - bezier = [NSBezierPath bezierPath]; - [bezier setLineWidth:1.0]; - [bezier moveToPoint:NSMakePoint(NSMinX(aRect), NSMaxY(aRect))]; - [bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect))]; - [bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMinY(aRect))]; - - if ([[cell customControlView] frame].size.height < 2) { - // special case of hidden control; need line across top of cell - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y + 0.5)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y + 0.5)]; - } - - [shadow setShadowOffset:NSMakeSize(2, -2)]; - [shadow set]; - [bezier stroke]; - } else { - NSRect aRect; - - if (_drawsRight) { - aRect = NSMakeRect(cellFrame.origin.x - 1, cellFrame.origin.y, cellFrame.size.width - 3, cellFrame.size.height); - } else { - aRect = NSMakeRect(cellFrame.origin.x + 2, cellFrame.origin.y, cellFrame.size.width - 2, cellFrame.size.height); - } - - // background - if (_drawsUnified) { - if ([[[tabBar tabView] window] isKeyWindow]) { - NSBezierPath *path = [NSBezierPath bezierPathWithRect:aRect]; - [path linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]]; - } else { - [[NSColor windowBackgroundColor] set]; - NSRectFill(aRect); - } - } else { - NSBezierPath *path = [NSBezierPath bezierPathWithRect:aRect]; - if (_drawsRight) { - [path linearVerticalGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.92 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.98 alpha:1.0]]; - } else { - [path linearVerticalGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.98 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.92 alpha:1.0]]; - } - } - - // frame - //top line - [lineColor set]; - [bezier setLineWidth:1.0]; - [bezier moveToPoint:NSMakePoint(NSMinX(aRect), NSMinY(aRect))]; - [bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMinY(aRect))]; - [bezier stroke]; - - //outer edge and bottom lines - bezier = [NSBezierPath bezierPath]; - [bezier setLineWidth:1.0]; - if (_drawsRight) { - //Right - [bezier moveToPoint:NSMakePoint(NSMaxX(aRect), NSMinY(aRect))]; - [bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect))]; - //Bottom - [bezier lineToPoint:NSMakePoint(NSMinX(aRect), NSMaxY(aRect))]; - } else { - //Left - [bezier moveToPoint:NSMakePoint(NSMinX(aRect), NSMinY(aRect))]; - [bezier lineToPoint:NSMakePoint(NSMinX(aRect), NSMaxY(aRect))]; - //Bottom - [bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect))]; - } - [shadow setShadowOffset:NSMakeSize((_drawsRight ? 2 : -2), -2)]; - [shadow set]; - [bezier stroke]; - } - } else { - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - - // rollover - if ([cell isHighlighted]) { - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositeSourceAtop); - } - - // frame - [lineColor set]; - - if (orientation == PSMTabBarHorizontalOrientation) { - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y)]; - if (!([cell tabState] & PSMTab_RightIsSelectedMask)) { - //draw the tab divider - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y + aRect.size.height)]; - } - [bezier stroke]; - - } else { - //No outline for vertical - } - } - - [NSGraphicsContext restoreGraphicsState]; - [shadow release]; - - [self drawInteriorWithTabCell:cell inView:[cell customControlView]]; -} - -- (void)drawBackgroundInRect:(NSRect)rect -{ - //Draw for our whole bounds; it'll be automatically clipped to fit the appropriate drawing area - rect = [tabBar bounds]; - - switch (orientation) { - case PSMTabBarHorizontalOrientation: - if (_drawsUnified && [[[tabBar tabView] window] isKeyWindow]) { - if ([[[tabBar tabView] window] isKeyWindow]) { - NSBezierPath *backgroundPath = [NSBezierPath bezierPathWithRect:rect]; - [backgroundPath linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]]; - } else { - [[NSColor windowBackgroundColor] set]; - NSRectFill(rect); - } - } else { - [[NSColor colorWithCalibratedWhite:0.85 alpha:0.6] set]; - [NSBezierPath fillRect:rect]; - } - break; - - case PSMTabBarVerticalOrientation: - //This is the Mail.app source list background color... which differs from the iTunes one. - [[NSColor colorWithCalibratedRed:.9059 - green:.9294 - blue:.9647 - alpha:1.0] set]; - NSRectFill(rect); - break; - } - - //Draw the border and shadow around the tab bar itself - [NSGraphicsContext saveGraphicsState]; - [[NSGraphicsContext currentContext] setShouldAntialias:NO]; - - NSShadow *shadow = [[NSShadow alloc] init]; - [shadow setShadowBlurRadius:2]; - [shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.6 alpha:1.0]]; - - [[NSColor grayColor] set]; - - NSBezierPath *path = [NSBezierPath bezierPath]; - [path setLineWidth:1.0]; - - switch (orientation) { - case PSMTabBarHorizontalOrientation: - { - rect.origin.y++; - [path moveToPoint:NSMakePoint(rect.origin.x, rect.origin.y)]; - [path lineToPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y)]; - [shadow setShadowOffset:NSMakeSize(2, -2)]; - - [shadow set]; - [path stroke]; - - break; - } - - case PSMTabBarVerticalOrientation: - { - NSPoint startPoint, endPoint; - NSSize shadowOffset; - - //Draw vertical shadow - if (_drawsRight) { - startPoint = NSMakePoint(NSMinX(rect), NSMinY(rect)); - endPoint = NSMakePoint(NSMinX(rect), NSMaxY(rect)); - shadowOffset = NSMakeSize(2, -2); - } else { - startPoint = NSMakePoint(NSMaxX(rect) - 1, NSMinY(rect)); - endPoint = NSMakePoint(NSMaxX(rect) - 1, NSMaxY(rect)); - shadowOffset = NSMakeSize(-2, -2); - } - - [path moveToPoint:startPoint]; - [path lineToPoint:endPoint]; - [shadow setShadowOffset:shadowOffset]; - - [shadow set]; - [path stroke]; - - [path removeAllPoints]; - - //Draw top horizontal shadow - startPoint = NSMakePoint(NSMinX(rect), NSMinY(rect)); - endPoint = NSMakePoint(NSMaxX(rect), NSMinY(rect)); - shadowOffset = NSMakeSize(0, -1); - - [path moveToPoint:startPoint]; - [path lineToPoint:endPoint]; - [shadow setShadowOffset:shadowOffset]; - - [shadow set]; - [path stroke]; - - break; - } - } - - [shadow release]; - [NSGraphicsContext restoreGraphicsState]; -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - if (orientation != [bar orientation]) { - orientation = [bar orientation]; - } - - if (tabBar != bar) { - [tabBar release]; - tabBar = [bar retain]; - } - - [self drawBackgroundInRect:rect]; - - // no tab view == not connected - if (![bar tabView]) { - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - NSMutableParagraphStyle *centeredParagraphStyle = nil; - - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; - } - - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [centeredParagraphStyle release]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while ( (cell = [e nextObject]) ) { - if ([bar isAnimating] || (![cell isInOverflowMenu] && NSIntersectsRect([cell frame], rect))) { - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:_closeButton forKey:@"closeButton"]; - [aCoder encodeObject:_closeButtonDown forKey:@"closeButtonDown"]; - [aCoder encodeObject:_closeButtonOver forKey:@"closeButtonOver"]; - [aCoder encodeObject:_closeDirtyButton forKey:@"closeDirtyButton"]; - [aCoder encodeObject:_closeDirtyButtonDown forKey:@"closeDirtyButtonDown"]; - [aCoder encodeObject:_closeDirtyButtonOver forKey:@"closeDirtyButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - [aCoder encodeBool:_drawsUnified forKey:@"drawsUnified"]; - [aCoder encodeBool:_drawsRight forKey:@"drawsRight"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - if ( (self = [super init]) ) { - if ([aDecoder allowsKeyedCoding]) { - _closeButton = [[aDecoder decodeObjectForKey:@"closeButton"] retain]; - _closeButtonDown = [[aDecoder decodeObjectForKey:@"closeButtonDown"] retain]; - _closeButtonOver = [[aDecoder decodeObjectForKey:@"closeButtonOver"] retain]; - _closeDirtyButton = [[aDecoder decodeObjectForKey:@"closeDirtyButton"] retain]; - _closeDirtyButtonDown = [[aDecoder decodeObjectForKey:@"closeDirtyButtonDown"] retain]; - _closeDirtyButtonOver = [[aDecoder decodeObjectForKey:@"closeDirtyButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - _drawsUnified = [aDecoder decodeBoolForKey:@"drawsUnified"]; - _drawsRight = [aDecoder decodeBoolForKey:@"drawsRight"]; - } - } - return self; -} - -@end diff --git a/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.h b/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.h deleted file mode 100644 index d3448e41..00000000 --- a/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// PSMAquaTabStyle.h -// PSMTabBarControl -// -// Created by John Pannell on 2/17/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import <Cocoa/Cocoa.h> -#import "PSMTabStyle.h" - -@interface PSMAquaTabStyle : NSObject <PSMTabStyle> { - NSImage *aquaTabBg; - NSImage *aquaTabBgDown; - NSImage *aquaTabBgDownGraphite; - NSImage *aquaTabBgDownNonKey; - NSImage *aquaDividerDown; - NSImage *aquaDivider; - NSImage *aquaCloseButton; - NSImage *aquaCloseButtonDown; - NSImage *aquaCloseButtonOver; - NSImage *aquaCloseDirtyButton; - NSImage *aquaCloseDirtyButtonDown; - NSImage *aquaCloseDirtyButtonOver; - NSImage *_addTabButtonImage; - NSImage *_addTabButtonPressedImage; - NSImage *_addTabButtonRolloverImage; - - NSDictionary *_objectCountStringAttributes; - PSMTabBarControl *tabBar; -} - -- (void)loadImages; -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; - -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; -@end diff --git a/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m deleted file mode 100644 index a96724c0..00000000 --- a/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m +++ /dev/null @@ -1,573 +0,0 @@ -// -// PSMAquaTabStyle.m -// PSMTabBarControl -// -// Created by John Pannell on 2/17/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import "PSMAquaTabStyle.h" -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" - -#define kPSMAquaObjectCounterRadius 7.0 -#define kPSMAquaCounterMinWidth 20 - -@implementation PSMAquaTabStyle - -- (NSString *)name -{ - return @"Aqua"; -} - -#pragma mark - -#pragma mark Creation/Destruction - -- (id) init -{ - if ( (self = [super init]) ) { - [self loadImages]; - - _objectCountStringAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:[[NSFontManager sharedFontManager] convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask], NSFontAttributeName, - [[NSColor whiteColor] colorWithAlphaComponent:0.85], NSForegroundColorAttributeName, - nil, nil]; - } - return self; -} - -- (void) loadImages -{ - // Aqua Tabs Images - aquaTabBg = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsBackground"]]; - [aquaTabBg setFlipped:YES]; - - aquaTabBgDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsDown"]]; - [aquaTabBgDown setFlipped:YES]; - - aquaTabBgDownGraphite = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsDownGraphite"]]; - [aquaTabBgDown setFlipped:YES]; - - aquaTabBgDownNonKey = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsDownNonKey"]]; - [aquaTabBgDown setFlipped:YES]; - - aquaDividerDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsSeparatorDown"]]; - [aquaDivider setFlipped:NO]; - - aquaDivider = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabsSeparator"]]; - [aquaDivider setFlipped:NO]; - - aquaCloseButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front"]]; - aquaCloseButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Pressed"]]; - aquaCloseButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Rollover"]]; - - aquaCloseDirtyButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front"]]; - aquaCloseDirtyButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front_Pressed"]]; - aquaCloseDirtyButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNew"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewRollover"]]; -} - -- (void)dealloc -{ - [aquaTabBg release]; - [aquaTabBgDown release]; - [aquaDividerDown release]; - [aquaDivider release]; - [aquaCloseButton release]; - [aquaCloseButtonDown release]; - [aquaCloseButtonOver release]; - [aquaCloseDirtyButton release]; - [aquaCloseDirtyButtonDown release]; - [aquaCloseDirtyButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - - [_objectCountStringAttributes release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Control Specifics - -- (CGFloat)leftMarginForTabBarControl -{ - return 0.0f; -} - -- (CGFloat)rightMarginForTabBarControl -{ - return 24.0f; -} - -- (CGFloat)topMarginForTabBarControl -{ - return 0.0f; -} - -- (void)setOrientation:(PSMTabBarOrientation)value -{ - -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -#pragma mark - -#pragma mark Cell Specifics - -- (NSRect)dragRectForTabCell:(PSMTabBarCell *)cell orientation:(PSMTabBarOrientation)orientation -{ - return [cell frame]; -} - -- (NSRect)closeButtonRectForTabCell:(PSMTabBarCell *)cell withFrame:(NSRect)cellFrame -{ - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [aquaCloseButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 2.0; - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - result.origin.x += [aquaCloseButton size].width + kPSMTabBarCellPadding; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - CGFloat countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMAquaObjectCounterRadius - 6.0); - if (countWidth < kPSMAquaCounterMinWidth) { - countWidth = kPSMAquaCounterMinWidth; - } - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMAquaObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if (![[cell indicator] isHidden]) { - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - } - - return result; -} - -- (CGFloat)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - CGFloat resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [aquaCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if ([cell hasIcon]) { - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - } - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if ([cell count] > 0) { - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - } - - // indicator? - if ([[cell indicator] isHidden] == NO) { - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - } - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (CGFloat)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - CGFloat resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - resultWidth += [aquaCloseButton size].width + kPSMTabBarCellPadding; - } - - // icon? - if ([cell hasIcon]) { - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - } - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if ([cell count] > 0) { - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - } - - // indicator? - if ([[cell indicator] isHidden] == NO) { - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - } - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (CGFloat)tabCellHeight -{ - return kPSMTabBarControlHeight; -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSString *contents = [NSString stringWithFormat:@"%lu", (unsigned long)[cell count]]; - return [[[NSMutableAttributedString alloc] initWithString:contents attributes:_objectCountStringAttributes] autorelease]; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString * contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - - // Paragraph Style for Truncating Long Text - static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; - if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; - [TruncatingTailParagraphStyle setAlignment:NSCenterTextAlignment]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:TruncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark Drawing - -- (void)drawTabCell:(PSMTabBarCell *)cell; -{ - NSRect cellFrame = [cell frame]; - - // Selected Tab - if ([cell state] == NSOnState) { - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height-2.5); - aRect.size.height -= 0.5; - - // proper tint - NSControlTint currentTint; - if ([cell controlTint] == NSDefaultControlTint) - currentTint = [NSColor currentControlTint]; - else - currentTint = [cell controlTint]; - - if (![[[cell customControlView] window] isKeyWindow]) - currentTint = NSClearControlTint; - - NSImage *bgImage; - switch (currentTint) { - case NSGraphiteControlTint: - bgImage = aquaTabBgDownGraphite; - break; - case NSClearControlTint: - bgImage = aquaTabBgDownNonKey; - break; - case NSBlueControlTint: - default: - bgImage = aquaTabBgDown; - break; - } - - [bgImage drawInRect:cellFrame fromRect:NSMakeRect(0.0, 0.0, 1.0, 22.0) operation:NSCompositeSourceOver fraction:1.0]; - [aquaDivider compositeToPoint:NSMakePoint(cellFrame.origin.x + cellFrame.size.width - 1.0, cellFrame.origin.y + cellFrame.size.height) operation:NSCompositeSourceOver]; - - aRect.size.height+=0.5; - - } else { // Unselected Tab - - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - aRect.origin.y += 0.5; - aRect.origin.x += 1.5; - aRect.size.width -= 1; - - aRect.origin.x -= 1; - aRect.size.width += 1; - - // Rollover - if ([cell isHighlighted]) { - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositeSourceAtop); - } - - [aquaDivider compositeToPoint:NSMakePoint(cellFrame.origin.x + cellFrame.size.width - 1.0, cellFrame.origin.y + cellFrame.size.height) operation:NSCompositeSourceOver]; - } - - [self drawInteriorWithTabCell:cell inView:[cell customControlView]]; -} - -- (void)drawBackgroundInRect:(NSRect)rect -{ - if (rect.size.height <= 22.0) { - //Draw for our whole bounds; it'll be automatically clipped to fit the appropriate drawing area - rect = [tabBar bounds]; - - [aquaTabBg drawInRect:rect fromRect:NSMakeRect(0.0, 0.0, 1.0, 22.0) operation:NSCompositeSourceOver fraction:1.0]; - } -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - if (tabBar != bar) { - tabBar = bar; - } - - [self drawBackgroundInRect:rect]; - - // no tab view == not connected - if (![bar tabView]) { - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - NSMutableParagraphStyle *centeredParagraphStyle = nil; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [centeredParagraphStyle release]; - [attrStr drawInRect:labelRect]; - return; - } - - // Draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while ( (cell = [e nextObject]) ) { - if ([bar isAnimating] || (![cell isInOverflowMenu] && NSIntersectsRect([cell frame], rect))) { - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - CGFloat labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage *closeButton = nil; - - closeButton = [cell isEdited] ? aquaCloseDirtyButton : aquaCloseButton; - - if ([cell closeButtonOver]) closeButton = [cell isEdited] ? aquaCloseDirtyButtonOver : aquaCloseButtonOver; - if ([cell closeButtonPressed]) closeButton = [cell isEdited] ? aquaCloseDirtyButtonDown : aquaCloseButtonDown; - - closeButtonSize = [closeButton size]; - - [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; - } - - // icon - if ([cell hasIcon]) { - NSRect iconRect = [self iconRectForTabCell:cell]; - NSImage *icon = [[[cell representedObject] identifier] icon]; - - // center in available space (in case icon image is smaller than kPSMTabBarIconWidth) - if ([icon size].width < kPSMTabBarIconWidth) { - iconRect.origin.x += (kPSMTabBarIconWidth - [icon size].width) / 2.0; - } - - if ([icon size].height < kPSMTabBarIconWidth) { - iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height) / 2.0; - } - - [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += iconRect.size.width + kPSMTabBarCellPadding; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - labelRect.size.height = cellFrame.size.height; - labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if (![[cell indicator] isHidden]) { - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - } - - // object counter - if ([cell count] > 0) { - [[cell countColor] ?: [NSColor colorWithCalibratedWhite:0.3 alpha:0.45] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMAquaObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMAquaObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMAquaObjectCounterRadius, myRect.origin.y + kPSMAquaObjectCounterRadius) radius:kPSMAquaObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMAquaObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMAquaObjectCounterRadius, myRect.origin.y + kPSMAquaObjectCounterRadius) radius:kPSMAquaObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - - labelRect.size.width -= myRect.size.width + kPSMTabBarCellPadding; - } - - // Draw Label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder { - - //[super encodeWithCoder:aCoder]; -/* - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:aquaTabBg forKey:@"aquaTabBg"]; - [aCoder encodeObject:aquaTabBgDown forKey:@"aquaTabBgDown"]; - [aCoder encodeObject:aquaTabBgDownGraphite forKey:@"aquaTabBgDownGraphite"]; - [aCoder encodeObject:aquaTabBgDownNonKey forKey:@"aquaTabBgDownNonKey"]; - [aCoder encodeObject:aquaDividerDown forKey:@"aquaDividerDown"]; - [aCoder encodeObject:aquaDivider forKey:@"aquaDivider"]; - [aCoder encodeObject:aquaCloseButton forKey:@"aquaCloseButton"]; - [aCoder encodeObject:aquaCloseButtonDown forKey:@"aquaCloseButtonDown"]; - [aCoder encodeObject:aquaCloseButtonOver forKey:@"aquaCloseButtonOver"]; - [aCoder encodeObject:aquaCloseDirtyButton forKey:@"aquaCloseDirtyButton"]; - [aCoder encodeObject:aquaCloseDirtyButtonDown forKey:@"aquaCloseDirtyButtonDown"]; - [aCoder encodeObject:aquaCloseDirtyButtonOver forKey:@"aquaCloseDirtyButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } - */ -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - - self = [self init]; - if (self) { -/* - if ([aDecoder allowsKeyedCoding]) { - aquaTabBg = [[aDecoder decodeObjectForKey:@"aquaTabBg"] retain]; - aquaTabBgDown = [[aDecoder decodeObjectForKey:@"aquaTabBgDown"] retain]; - aquaTabBgDownGraphite = [[aDecoder decodeObjectForKey:@"aquaTabBgDownGraphite"] retain]; - aquaTabBgDownNonKey = [[aDecoder decodeObjectForKey:@"aquaTabBgDownNonKey"] retain]; - aquaDividerDown = [[aDecoder decodeObjectForKey:@"aquaDividerDown"] retain]; - aquaDivider = [[aDecoder decodeObjectForKey:@"aquaDivider"] retain]; - aquaCloseButton = [[aDecoder decodeObjectForKey:@"aquaCloseButton"] retain]; - aquaCloseButtonDown = [[aDecoder decodeObjectForKey:@"aquaCloseButtonDown"] retain]; - aquaCloseButtonOver = [[aDecoder decodeObjectForKey:@"aquaCloseButtonOver"] retain]; - aquaCloseDirtyButton = [[aDecoder decodeObjectForKey:@"aquaCloseDirtyButton"] retain]; - aquaCloseDirtyButtonDown = [[aDecoder decodeObjectForKey:@"aquaCloseDirtyButtonDown"] retain]; - aquaCloseDirtyButtonOver = [[aDecoder decodeObjectForKey:@"aquaCloseDirtyButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - - } -*/ - } - return self; -} - -@end diff --git a/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.h b/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.h deleted file mode 100644 index b04f83d1..00000000 --- a/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// PSMCardTabStyle.h -// Fichiers -// -// Created by Michael Monscheuer on 05.11.09. -// Copyright 2009 WriteFlow KG, Wien. All rights reserved. -// - -#import <Cocoa/Cocoa.h> -#import "PSMTabStyle.h" - -@interface PSMCardTabStyle : NSObject <PSMTabStyle> -{ - NSImage *unifiedCloseButton; - NSImage *unifiedCloseButtonDown; - NSImage *unifiedCloseButtonOver; - NSImage *unifiedCloseDirtyButton; - NSImage *unifiedCloseDirtyButtonDown; - NSImage *unifiedCloseDirtyButtonOver; - NSImage *_addTabButtonImage; - NSImage *_addTabButtonPressedImage; - NSImage *_addTabButtonRolloverImage; - - NSDictionary *_objectCountStringAttributes; - - CGFloat leftMargin; - PSMTabBarControl *tabBar; -} - -- (void)setLeftMarginForTabBarControl:(CGFloat)margin; - -@end diff --git a/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m deleted file mode 100644 index d81458f1..00000000 --- a/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m +++ /dev/null @@ -1,643 +0,0 @@ -// -// PSMCardTabStyle.m -// Fichiers -// -// Created by Michael Monscheuer on 05.11.09. -// Copyright 2009 WriteFlow KG, Wien. All rights reserved. -// - -#import "PSMCardTabStyle.h" -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" -#import "NSBezierPath_AMShading.h" - -#define kPSMUnifiedObjectCounterRadius 7.0 -#define kPSMUnifiedCounterMinWidth 20 - -@interface PSMCardTabStyle (Private) -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; -@end - -@implementation PSMCardTabStyle - -- (NSString *)name -{ - return @"Card"; -} - -#pragma mark - -#pragma mark Creation/Destruction - -- (id) init -{ - if ( (self = [super init]) ) { - unifiedCloseButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front"]]; - unifiedCloseButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Pressed"]]; - unifiedCloseButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Rollover"]]; - - unifiedCloseDirtyButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front"]]; - unifiedCloseDirtyButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front_Pressed"]]; - unifiedCloseDirtyButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNew"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewRollover"]]; - - _objectCountStringAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:[[NSFontManager sharedFontManager] convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask], NSFontAttributeName, - [[NSColor whiteColor] colorWithAlphaComponent:0.85], NSForegroundColorAttributeName, - nil, nil]; - - leftMargin = 5.0; - } - return self; -} - -- (void)dealloc -{ - [unifiedCloseButton release]; - [unifiedCloseButtonDown release]; - [unifiedCloseButtonOver release]; - [unifiedCloseDirtyButton release]; - [unifiedCloseDirtyButtonDown release]; - [unifiedCloseDirtyButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - - [_objectCountStringAttributes release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Control Specific - -- (void)setLeftMarginForTabBarControl:(CGFloat)margin -{ - leftMargin = margin; -} - -- (CGFloat)leftMarginForTabBarControl -{ - return leftMargin; -} - -- (CGFloat)rightMarginForTabBarControl -{ - return 5.0f; -// return 24.0f; -} - -- (CGFloat)topMarginForTabBarControl -{ - return 10.0f; -} - -- (void)setOrientation:(PSMTabBarOrientation)value -{ - -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect)dragRectForTabCell:(PSMTabBarCell *)cell orientation:(PSMTabBarOrientation)orientation -{ - NSRect dragRect = [cell frame]; - dragRect.size.width++; - return dragRect; -} - -- (NSRect)closeButtonRectForTabCell:(PSMTabBarCell *)cell withFrame:(NSRect)cellFrame -{ - if ([cell hasCloseButton] == NO || [cell isCloseButtonSuppressed]) { - return NSZeroRect; - } - - NSRect result; - result.size = [unifiedCloseButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y - 1.0; - - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - result.origin.x += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y - 1.0; - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - CGFloat countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMUnifiedObjectCounterRadius - 6.0); - if (countWidth < kPSMUnifiedCounterMinWidth) { - countWidth = kPSMUnifiedCounterMinWidth; - } - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMUnifiedObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if (![[cell indicator] isHidden]) { - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - } - - return result; -} - - -- (CGFloat)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - CGFloat resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - resultWidth += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - } - - // icon? - if ([cell hasIcon]) { - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - } - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if ([cell count] > 0) { - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - } - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (CGFloat)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - CGFloat resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if ([cell hasIcon]) { - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - } - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if ([cell count] > 0) { - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - } - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (CGFloat)tabCellHeight -{ - return kPSMTabBarControlHeight; -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSString *contents = [NSString stringWithFormat:@"%lu", (unsigned long)[cell count]]; - return [[[NSMutableAttributedString alloc] initWithString:contents attributes:_objectCountStringAttributes] autorelease]; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString * contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - - // Paragraph Style for Truncating Long Text - static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; - if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:TruncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - BOOL showsBaselineSeparator = NO; -/* - NSToolbar *toolbar = [[[cell controlView] window] toolbar]; - BOOL showsBaselineSeparator = (toolbar && [toolbar respondsToSelector:@selector(showsBaselineSeparator)] && [toolbar showsBaselineSeparator]); -*/ - if (!showsBaselineSeparator) { - cellFrame.origin.y += 3.0; - cellFrame.size.height -= 3.0; - } - - - NSColor * lineColor = nil; - NSBezierPath* bezier = [NSBezierPath bezierPath]; - lineColor = [NSColor colorWithCalibratedWhite:0.576 alpha:1.0]; - - if (!showsBaselineSeparator || [cell state] == NSOnState) - { -// // selected tab -// NSRect aRect = NSMakeRect(cellFrame.origin.x+0.5, cellFrame.origin.y-0.5, cellFrame.size.width, cellFrame.size.height); - // selected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x+.5, cellFrame.origin.y+0.5, cellFrame.size.width-1.0, cellFrame.size.height-1.0); - - // frame - CGFloat radius = MIN(6.0, 0.5f * MIN(NSWidth(aRect), NSHeight(aRect)))-0.5; -// NSRect rect = NSInsetRect(aRect, radius, radius); - - [bezier moveToPoint: NSMakePoint(NSMinX(aRect),NSMaxY(aRect))]; - [bezier appendBezierPathWithArcFromPoint:NSMakePoint(NSMinX(aRect),NSMinY(aRect)) toPoint:NSMakePoint(NSMidX(aRect),NSMinY(aRect)) radius:radius]; - [bezier appendBezierPathWithArcFromPoint:NSMakePoint(NSMaxX(aRect),NSMinY(aRect)) toPoint:NSMakePoint(NSMaxX(aRect),NSMaxY(aRect)) radius:radius]; - [bezier lineToPoint: NSMakePoint(NSMaxX(aRect),NSMaxY(aRect))]; - -/* - [bezier appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMinY(rect)) radius:radius startAngle:180.0 endAngle:270.0]; - - [bezier appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMinY(rect)) radius:radius startAngle:270.0 endAngle:360.0]; - - NSPoint cornerPoint = NSMakePoint(NSMaxX(aRect), NSMaxY(aRect)); - [bezier appendBezierPathWithPoints:&cornerPoint count:1]; - - cornerPoint = NSMakePoint(NSMinX(aRect), NSMaxY(aRect)); - [bezier appendBezierPathWithPoints:&cornerPoint count:1]; - - [bezier closePath]; -*/ - - //[[NSColor windowBackgroundColor] set]; - //[bezier fill]; - if ([NSApp isActive]) { - if ([cell state] == NSOnState) { - [bezier linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.99 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.941 alpha:1.0]]; - } else if ([cell isHighlighted]) { - [bezier linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.80 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.80 alpha:1.0]]; - } else { - [bezier linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]]; - } - } - - [lineColor set]; - [bezier stroke]; - - } - else - { - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - aRect.origin.y += 0.5; - aRect.origin.x += 1.5; - aRect.size.width -= 1; - - aRect.origin.x -= 1; - aRect.size.width += 1; - - // rollover - if ([cell isHighlighted]) - { - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositeSourceAtop); - } - - // frame - - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y-0.5)]; - if (!([cell tabState] & PSMTab_RightIsSelectedMask)) { - [bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect))]; - } - - [bezier stroke]; - - // Create a thin lighter line next to the dividing line for a bezel effect - if (!([cell tabState] & PSMTab_RightIsSelectedMask)) { - [[[NSColor redColor] colorWithAlphaComponent:0.5] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(NSMaxX(aRect)+1.0, aRect.origin.y-0.5) - toPoint:NSMakePoint(NSMaxX(aRect)+1.0, NSMaxY(aRect)-2.5)]; - } - - // If this is the leftmost tab, we want to draw a line on the left, too - if ([cell tabState] & PSMTab_PositionLeftMask) - { - [lineColor set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(aRect.origin.x,aRect.origin.y-0.5) - toPoint:NSMakePoint(aRect.origin.x,NSMaxY(aRect)-2.5)]; - [[[NSColor redColor] colorWithAlphaComponent:0.5] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(aRect.origin.x+1.0,aRect.origin.y-0.5) - toPoint:NSMakePoint(aRect.origin.x+1.0,NSMaxY(aRect)-2.5)]; - } - } - - [self drawInteriorWithTabCell:cell inView:[cell customControlView]]; -} - - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - - BOOL showsBaselineSeparator = NO; -/* - NSToolbar *toolbar = [[[cell customControlView] window] toolbar]; - BOOL showsBaselineSeparator = (toolbar && [toolbar respondsToSelector:@selector(showsBaselineSeparator)] && [toolbar showsBaselineSeparator]); -*/ - if (!showsBaselineSeparator) { - cellFrame.origin.y += 3.0; - cellFrame.size.height -= 3.0; - } - - CGFloat labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage * closeButton = nil; - - closeButton = [cell isEdited] ? unifiedCloseDirtyButton : unifiedCloseButton; - - if ([cell closeButtonOver]) closeButton = [cell isEdited] ? unifiedCloseDirtyButtonOver : unifiedCloseButtonOver; - if ([cell closeButtonPressed]) closeButton = [cell isEdited] ? unifiedCloseDirtyButtonDown : unifiedCloseButtonDown; - - closeButtonSize = [closeButton size]; - - [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; - } - - // icon - if ([cell hasIcon]) { - NSRect iconRect = [self iconRectForTabCell:cell]; - NSImage *icon = [[[cell representedObject] identifier] icon]; - - // center in available space (in case icon image is smaller than kPSMTabBarIconWidth) - if ([icon size].width < kPSMTabBarIconWidth) { - iconRect.origin.x += (kPSMTabBarIconWidth - [icon size].width) / 2.0; - } - if ([icon size].height < kPSMTabBarIconWidth) { - iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height) / 2.0; - } - - [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += iconRect.size.width + kPSMTabBarCellPadding; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - NSSize s = [[cell attributedStringValue] size]; - labelRect.origin.y = cellFrame.origin.y + (cellFrame.size.height-s.height)/2 + 1; - labelRect.size.height = s.height; - - if (![[cell indicator] isHidden]) { - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - } - - // object counter - if ([cell count] > 0) { - [[cell countColor] ?: [NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - myRect.origin.y -= 1.0; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMUnifiedObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMUnifiedObjectCounterRadius, myRect.origin.y + kPSMUnifiedObjectCounterRadius) radius:kPSMUnifiedObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y + kPSMUnifiedObjectCounterRadius) radius:kPSMUnifiedObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - - labelRect.size.width -= myRect.size.width + kPSMTabBarCellPadding; - } - - // label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawBackgroundInRect:(NSRect)rect -{ - //Draw for our whole bounds; it'll be automatically clipped to fit the appropriate drawing area - rect = [tabBar bounds]; - - NSRect gradientRect = rect; - gradientRect.size.height -= 1.0; - - NSBezierPath *path = [NSBezierPath bezierPathWithRect:gradientRect]; - [path linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]]; - [[NSColor colorWithCalibratedWhite:0.576 alpha:1.0] set]; - - - if (![[[tabBar tabView] window] isKeyWindow]) { - [[NSColor windowBackgroundColor] set]; - NSRectFill(gradientRect); - } -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - [NSGraphicsContext saveGraphicsState]; - - // draw button separator - for(PSMTabBarCell *cell in [bar cells]) - { - if([cell state] == NSOnState) - { - [[NSColor colorWithCalibratedWhite:0.576 alpha:1.0] set]; - - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,NSMaxY(rect)-0.5) - toPoint:NSMakePoint(NSMinX([cell frame]),NSMaxY(rect)-0.5)]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(NSMaxX([cell frame]),NSMaxY(rect)-0.5) - toPoint:NSMakePoint(NSMaxX(rect),NSMaxY(rect)-0.5)]; - } - } - - tabBar = bar; - [self drawBackgroundInRect:rect]; - - // no tab view == not connected - if (![bar tabView]) { - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - NSMutableParagraphStyle *centeredParagraphStyle = nil; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [centeredParagraphStyle release]; - [attrStr drawInRect:labelRect]; - - goto EXIT; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while ( (cell = [e nextObject]) ) { - if ([bar isAnimating] || (![cell isInOverflowMenu] && NSIntersectsRect([cell frame], rect))) { - [cell drawWithFrame:[cell frame] inView:bar]; - } - } - -EXIT: - [NSGraphicsContext restoreGraphicsState]; - -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ -/* - //[super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:unifiedCloseButton forKey:@"unifiedCloseButton"]; - [aCoder encodeObject:unifiedCloseButtonDown forKey:@"unifiedCloseButtonDown"]; - [aCoder encodeObject:unifiedCloseButtonOver forKey:@"unifiedCloseButtonOver"]; - [aCoder encodeObject:unifiedCloseDirtyButton forKey:@"unifiedCloseDirtyButton"]; - [aCoder encodeObject:unifiedCloseDirtyButtonDown forKey:@"unifiedCloseDirtyButtonDown"]; - [aCoder encodeObject:unifiedCloseDirtyButtonOver forKey:@"unifiedCloseDirtyButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } -*/ -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - self = [self init]; - if (self) { - /* - if ([aDecoder allowsKeyedCoding]) { - unifiedCloseButton = [[aDecoder decodeObjectForKey:@"unifiedCloseButton"] retain]; - unifiedCloseButtonDown = [[aDecoder decodeObjectForKey:@"unifiedCloseButtonDown"] retain]; - unifiedCloseButtonOver = [[aDecoder decodeObjectForKey:@"unifiedCloseButtonOver"] retain]; - unifiedCloseDirtyButton = [[aDecoder decodeObjectForKey:@"unifiedCloseDirtyButton"] retain]; - unifiedCloseDirtyButtonDown = [[aDecoder decodeObjectForKey:@"unifiedCloseDirtyButtonDown"] retain]; - unifiedCloseDirtyButtonOver = [[aDecoder decodeObjectForKey:@"unifiedCloseDirtyButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - } - */ - } - return self; -} - -@end diff --git a/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.h b/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.h deleted file mode 100644 index 22cb7bc8..00000000 --- a/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// PSMMetalTabStyle.h -// PSMTabBarControl -// -// Created by John Pannell on 2/17/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import <Cocoa/Cocoa.h> -#import "PSMTabStyle.h" - -@interface PSMMetalTabStyle : NSObject <PSMTabStyle> { - NSImage *metalCloseButton; - NSImage *metalCloseButtonDown; - NSImage *metalCloseButtonOver; - NSImage *metalCloseDirtyButton; - NSImage *metalCloseDirtyButtonDown; - NSImage *metalCloseDirtyButtonOver; - NSImage *_addTabButtonImage; - NSImage *_addTabButtonPressedImage; - NSImage *_addTabButtonRolloverImage; - - NSDictionary *_objectCountStringAttributes; - - PSMTabBarOrientation orientation; - PSMTabBarControl *tabBar; -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; - -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - -@end diff --git a/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m deleted file mode 100644 index cdce6507..00000000 --- a/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m +++ /dev/null @@ -1,654 +0,0 @@ -// -// PSMMetalTabStyle.m -// PSMTabBarControl -// -// Created by John Pannell on 2/17/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import "PSMMetalTabStyle.h" -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" - -#define kPSMMetalObjectCounterRadius 7.0 -#define kPSMMetalCounterMinWidth 20 - -@implementation PSMMetalTabStyle - -- (NSString *)name -{ - return @"Metal"; -} - -#pragma mark - -#pragma mark Creation/Destruction - -- (id) init -{ - if ( (self = [super init]) ) { - metalCloseButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front"]]; - metalCloseButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front_Pressed"]]; - metalCloseButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front_Rollover"]]; - - metalCloseDirtyButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Dirty"]]; - metalCloseDirtyButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Dirty_Pressed"]]; - metalCloseDirtyButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Dirty_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetal"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetalPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetalRollover"]]; - - _objectCountStringAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:[[NSFontManager sharedFontManager] convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask], NSFontAttributeName, - [[NSColor whiteColor] colorWithAlphaComponent:0.85], NSForegroundColorAttributeName, - nil, nil]; - } - return self; -} - -- (void)dealloc -{ - [metalCloseButton release]; - [metalCloseButtonDown release]; - [metalCloseButtonOver release]; - [metalCloseDirtyButton release]; - [metalCloseDirtyButtonDown release]; - [metalCloseDirtyButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - - [_objectCountStringAttributes release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Control Specific - -- (CGFloat)leftMarginForTabBarControl -{ - return 10.0f; -} - -- (CGFloat)rightMarginForTabBarControl -{ - return 24.0f; -} - -- (CGFloat)topMarginForTabBarControl -{ - return 10.0f; -} - -- (void)setOrientation:(PSMTabBarOrientation)value -{ - orientation = value; -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect)dragRectForTabCell:(PSMTabBarCell *)cell orientation:(PSMTabBarOrientation)tabOrientation -{ - NSRect dragRect = [cell frame]; - dragRect.size.width++; - - if ([cell tabState] & PSMTab_SelectedMask) { - if (tabOrientation == PSMTabBarHorizontalOrientation) { - dragRect.size.height -= 2.0; - } else { - dragRect.size.height += 1.0; - dragRect.origin.y -= 1.0; - dragRect.origin.x += 2.0; - dragRect.size.width -= 3.0; - } - } else if (tabOrientation == PSMTabBarVerticalOrientation) { - dragRect.origin.x--; - } - - return dragRect; -} - -- (NSRect)closeButtonRectForTabCell:(PSMTabBarCell *)cell withFrame:(NSRect)cellFrame -{ - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [metalCloseButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 2.0; - - if ([cell state] == NSOnState) { - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - result.origin.x += [metalCloseButton size].width + kPSMTabBarCellPadding; - } - - if ([cell state] == NSOnState) { - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if ([cell state] == NSOnState) { - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - CGFloat countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMMetalObjectCounterRadius - 6.0); - if (countWidth < kPSMMetalCounterMinWidth) { - countWidth = kPSMMetalCounterMinWidth; - } - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMMetalObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if (![[cell indicator] isHidden]) { - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - } - - return result; -} - - -- (CGFloat)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - CGFloat resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - resultWidth += [metalCloseButton size].width + kPSMTabBarCellPadding; - } - - // icon? - if ([cell hasIcon]) { - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - } - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if ([cell count] > 0) { - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - } - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (CGFloat)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - CGFloat resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [metalCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if ([cell hasIcon]) { - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - } - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if ([cell count] > 0) { - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - } - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (CGFloat)tabCellHeight -{ - return kPSMTabBarControlHeight; -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSString *contents = [NSString stringWithFormat:@"%lu", (unsigned long)[cell count]]; - return [[[NSMutableAttributedString alloc] initWithString:contents attributes:_objectCountStringAttributes] autorelease]; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString *contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[NSFont boldSystemFontOfSize:11.0] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor textColor] colorWithAlphaComponent:0.75] range:range]; - - // Add shadow attribute - NSShadow* shadow; - shadow = [[[NSShadow alloc] init] autorelease]; - CGFloat shadowAlpha; - if (([cell state] == NSOnState) || [cell isHighlighted]) { - shadowAlpha = 0.8; - } else { - shadowAlpha = 0.5; - } - [shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:shadowAlpha]]; - [shadow setShadowOffset:NSMakeSize(0, -1)]; - [shadow setShadowBlurRadius:1.0]; - [attrStr addAttribute:NSShadowAttributeName value:shadow range:range]; - - // Paragraph Style for Truncating Long Text - static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; - if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; - [TruncatingTailParagraphStyle setAlignment:NSCenterTextAlignment]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:TruncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - NSColor *lineColor = nil; - NSBezierPath *bezier = [NSBezierPath bezierPath]; - lineColor = [NSColor darkGrayColor]; - - //disable antialiasing of bezier paths - [NSGraphicsContext saveGraphicsState]; - [[NSGraphicsContext currentContext] setShouldAntialias:NO]; - - if ([cell state] == NSOnState) { - // selected tab - if (orientation == PSMTabBarHorizontalOrientation) { - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height-2.5); - - // background - aRect.origin.x += 1.0; - aRect.size.width--; - aRect.size.height -= 0.5; - NSDrawWindowBackground(aRect); - aRect.size.width++; - aRect.size.height += 0.5; - - // frame - aRect.origin.x -= 0.5; - [lineColor set]; - [bezier setLineWidth:1.0]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y+aRect.size.height-1.5)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+1.5, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width-2.5, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y+aRect.size.height-1.5)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y)]; - if ([[cell customControlView] frame].size.height < 2) { - // special case of hidden control; need line across top of cell - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y+0.5)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y+0.5)]; - } - } else { - NSRect aRect = NSMakeRect(cellFrame.origin.x + 2, cellFrame.origin.y, cellFrame.size.width - 2, cellFrame.size.height); - - // background - aRect.origin.x++; - aRect.size.height--; - NSDrawWindowBackground(aRect); - aRect.origin.x--; - aRect.size.height++; - - // frame - [lineColor set]; - [bezier setLineWidth:1.0]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + 2, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + 0.5, aRect.origin.y + 2)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + 0.5, aRect.origin.y + aRect.size.height - 3)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + 3, aRect.origin.y + aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y + aRect.size.height)]; - } - - [bezier stroke]; - } else { - - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - aRect.origin.y += 0.5; - aRect.origin.x += 1.5; - aRect.size.width -= 1; - - // rollover - if ([cell isHighlighted]) { - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositeSourceAtop); - } - - [lineColor set]; - - if (orientation == PSMTabBarHorizontalOrientation) { - aRect.origin.x -= 1; - aRect.size.width += 1; - - // frame - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y)]; - if (!([cell tabState] & PSMTab_RightIsSelectedMask)) { - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y + aRect.size.height)]; - } - } else { - if (!([cell tabState] & PSMTab_LeftIsSelectedMask)) { - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y)]; - } - - if (!([cell tabState] & PSMTab_RightIsSelectedMask)) { - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y + aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y + aRect.size.height)]; - } - } - [bezier stroke]; - } - - [NSGraphicsContext restoreGraphicsState]; - - [self drawInteriorWithTabCell:cell inView:[cell customControlView]]; -} - - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - CGFloat labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage * closeButton = nil; - - closeButton = [cell isEdited] ? metalCloseDirtyButton : metalCloseButton; - if ([cell closeButtonOver]) closeButton = [cell isEdited] ? metalCloseDirtyButtonOver : metalCloseButtonOver; - if ([cell closeButtonPressed]) closeButton = [cell isEdited] ? metalCloseDirtyButtonDown : metalCloseButtonDown; - - closeButtonSize = [closeButton size]; - - [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; - } - - // icon - if ([cell hasIcon]) { - NSRect iconRect = [self iconRectForTabCell:cell]; - NSImage *icon = [[[cell representedObject] identifier] icon]; - - if ([controlView isFlipped]) { - iconRect.origin.y += iconRect.size.height; - } - - // center in available space (in case icon image is smaller than kPSMTabBarIconWidth) - if ([icon size].width < kPSMTabBarIconWidth) { - iconRect.origin.x += (kPSMTabBarIconWidth - [icon size].width)/2.0; - } - if ([icon size].height < kPSMTabBarIconWidth) { - iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height)/2.0; - } - - [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += iconRect.size.width + kPSMTabBarCellPadding; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - labelRect.size.height = cellFrame.size.height; - labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if ([cell state] == NSOnState) { - labelRect.origin.y -= 1; - } - - if (![[cell indicator] isHidden]) { - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - } - - // object counter - if ([cell count] > 0) { - [[cell countColor] ?: [NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - if ([cell state] == NSOnState) { - myRect.origin.y -= 1.0; - } - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - - // shrink label width to make room for object counter - labelRect.size.width -= myRect.size.width + kPSMTabBarCellPadding; - } - - // draw label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawBackgroundInRect:(NSRect)rect -{ - //Draw for our whole bounds; it'll be automatically clipped to fit the appropriate drawing area - rect = [tabBar bounds]; - - if (orientation == PSMTabBarVerticalOrientation && [tabBar frame].size.width < 2) { - return; - } - - [NSGraphicsContext saveGraphicsState]; - [[NSGraphicsContext currentContext] setShouldAntialias:NO]; - - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; - NSRectFillUsingOperation(rect, NSCompositeSourceAtop); - [[NSColor darkGrayColor] set]; - - if (orientation == PSMTabBarHorizontalOrientation) { - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x, rect.origin.y + 0.5) toPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y + 0.5)]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x, rect.origin.y + rect.size.height - 0.5) toPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height - 0.5)]; - } else { - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x, rect.origin.y + 0.5) toPoint:NSMakePoint(rect.origin.x, rect.origin.y + rect.size.height + 0.5)]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y + 0.5) toPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height + 0.5)]; - } - - [NSGraphicsContext restoreGraphicsState]; -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - if (orientation != [bar orientation]) { - orientation = [bar orientation]; - } - - if (tabBar != bar) { - tabBar = bar; - } - - [self drawBackgroundInRect:rect]; - - // no tab view == not connected - if (![bar tabView]) { - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - NSMutableParagraphStyle *centeredParagraphStyle = nil; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [centeredParagraphStyle release]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while ( (cell = [e nextObject]) ) { - if ([bar isAnimating] || (![cell isInOverflowMenu] && NSIntersectsRect([cell frame], rect))) { - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - //[super encodeWithCoder:aCoder]; -/* - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:metalCloseButton forKey:@"metalCloseButton"]; - [aCoder encodeObject:metalCloseButtonDown forKey:@"metalCloseButtonDown"]; - [aCoder encodeObject:metalCloseButtonOver forKey:@"metalCloseButtonOver"]; - [aCoder encodeObject:metalCloseDirtyButton forKey:@"metalCloseDirtyButton"]; - [aCoder encodeObject:metalCloseDirtyButtonDown forKey:@"metalCloseDirtyButtonDown"]; - [aCoder encodeObject:metalCloseDirtyButtonOver forKey:@"metalCloseDirtyButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } -*/ -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - self = [self init]; - if (self) { - -/* - if ([aDecoder allowsKeyedCoding]) { - metalCloseButton = [[aDecoder decodeObjectForKey:@"metalCloseButton"] retain]; - metalCloseButtonDown = [[aDecoder decodeObjectForKey:@"metalCloseButtonDown"] retain]; - metalCloseButtonOver = [[aDecoder decodeObjectForKey:@"metalCloseButtonOver"] retain]; - metalCloseDirtyButton = [[aDecoder decodeObjectForKey:@"metalCloseDirtyButton"] retain]; - metalCloseDirtyButtonDown = [[aDecoder decodeObjectForKey:@"metalCloseDirtyButtonDown"] retain]; - metalCloseDirtyButtonOver = [[aDecoder decodeObjectForKey:@"metalCloseDirtyButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - } -*/ - } - return self; -} - -@end diff --git a/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.h b/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.h index d6f541a5..2e82845e 100644 --- a/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.h +++ b/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.h @@ -25,7 +25,8 @@ #import <Cocoa/Cocoa.h> #import "PSMTabStyle.h" -@interface PSMSequelProTabStyle : NSObject <PSMTabStyle> { +@interface PSMSequelProTabStyle : NSObject <PSMTabStyle> +{ BOOL systemVersionIsAtLeast10_7_0; BOOL systemVersionIsAtLeast10_10_0; @@ -45,7 +46,7 @@ PSMTabBarControl *tabBar; } -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; +- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView *)controlView; - (void)encodeWithCoder:(NSCoder *)aCoder; - (id)initWithCoder:(NSCoder *)aDecoder; diff --git a/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m index 4329032b..30501bb8 100644 --- a/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m @@ -1,6 +1,4 @@ // -// $Id: PSMSequelProTabStyle.m 2317 2010-06-15 10:19:41Z avenjamin $ -// // PSMSequelProTabStyle.m // sequel-pro // @@ -31,10 +29,9 @@ #define kPSMSequelProObjectCounterRadius 7.0f #define kPSMSequelProCounterMinWidth 20 #define kPSMSequelProTabCornerRadius 0 -#define MARGIN_X 6 #ifndef __MAC_10_10 -#define __MAC_10_10 101000 +#define __MAC_10_10 101000 #endif #if __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_10 @@ -46,12 +43,20 @@ typedef struct { } NSOperatingSystemVersion; @interface NSProcessInfo () + - (NSOperatingSystemVersion)operatingSystemVersion; - (BOOL)isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion)version; -@end +@end #endif +@interface PSMSequelProTabStyle () + +- (NSColor *)_lineColorForTabCellDrawing; +- (void)_drawTabCell:(PSMTabBarCell *)cell withBackgroundColor:(NSColor *)backgroundColor lineColor:(NSColor *)lineColor; + +@end + @implementation PSMSequelProTabStyle - (NSString *)name @@ -69,9 +74,11 @@ typedef struct { // This code actually belongs in it's own class, but since both PSMTabBar.framework // and SP itself would need it, the loader will complain about a duplicate class implementation. NSProcessInfo *procInfo = [NSProcessInfo processInfo]; - if([procInfo respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)]) { + + if ([procInfo respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)]) { NSOperatingSystemVersion os10_7_0 = {10,7,0}; NSOperatingSystemVersion os10_10_0 = {10,10,0}; + systemVersionIsAtLeast10_7_0 = [procInfo isOperatingSystemAtLeastVersion:os10_7_0]; systemVersionIsAtLeast10_10_0 = [procInfo isOperatingSystemAtLeastVersion:os10_10_0]; } @@ -85,21 +92,23 @@ typedef struct { systemVersionIsAtLeast10_10_0 = (versionMajor > 10 || (versionMajor == 10 && versionMinor >= 10)); } - sequelProCloseButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"SequelProTabClose"]]; - sequelProCloseButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"SequelProTabClose_Pressed"]]; - sequelProCloseButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"SequelProTabClose_Rollover"]]; + NSBundle *bundle = [PSMTabBarControl bundle]; + + sequelProCloseButton = [[NSImage alloc] initByReferencingFile:[bundle pathForImageResource:@"SequelProTabClose"]]; + sequelProCloseButtonDown = [[NSImage alloc] initByReferencingFile:[bundle pathForImageResource:@"SequelProTabClose_Pressed"]]; + sequelProCloseButtonOver = [[NSImage alloc] initByReferencingFile:[bundle pathForImageResource:@"SequelProTabClose_Rollover"]]; - sequelProCloseDirtyButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"SequelProTabDirty"]]; - sequelProCloseDirtyButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"SequelProTabDirty_Pressed"]]; - sequelProCloseDirtyButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"SequelProTabDirty_Rollover"]]; + sequelProCloseDirtyButton = [[NSImage alloc] initByReferencingFile:[bundle pathForImageResource:@"SequelProTabDirty"]]; + sequelProCloseDirtyButtonDown = [[NSImage alloc] initByReferencingFile:[bundle pathForImageResource:@"SequelProTabDirty_Pressed"]]; + sequelProCloseDirtyButtonOver = [[NSImage alloc] initByReferencingFile:[bundle pathForImageResource:@"SequelProTabDirty_Rollover"]]; - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[NSBundle mainBundle] pathForImageResource:@"button_add"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[NSBundle mainBundle] pathForImageResource:@"button_add"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[NSBundle mainBundle] pathForImageResource:@"button_add"]]; + _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[bundle pathForImageResource:@"AddTabButton"]]; + _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[bundle pathForImageResource:@"AddTabButton"]]; + _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[bundle pathForImageResource:@"AddTabButton"]]; - _objectCountStringAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:[[NSFontManager sharedFontManager] convertFont:[NSFont fontWithName:@"Helvetica" size:11.0f] toHaveTrait:NSBoldFontMask], NSFontAttributeName, - [[NSColor whiteColor] colorWithAlphaComponent:0.85f], NSForegroundColorAttributeName, - nil, nil]; + _objectCountStringAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: + [[NSFontManager sharedFontManager] convertFont:[NSFont fontWithName:@"Helvetica" size:11.0f] toHaveTrait:NSBoldFontMask], NSFontAttributeName, + [[NSColor whiteColor] colorWithAlphaComponent:0.85f], NSForegroundColorAttributeName, nil, nil]; } return self; } @@ -371,7 +380,6 @@ typedef struct { [textShadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0f alpha:shadowAlpha]]; [textShadow setShadowOffset:NSMakeSize(0, -1)]; [textShadow setShadowBlurRadius:1.0f]; -// [attrStr addAttribute:NSShadowAttributeName value:textShadow range:range]; // Paragraph Style for Truncating Long Text static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; @@ -433,23 +441,22 @@ typedef struct { } } - // Step 2 - (void)drawBackgroundInRect:(NSRect)rect { - //Draw for our whole bounds; it'll be automatically clipped to fit the appropriate drawing area + // Draw for our whole bounds; it'll be automatically clipped to fit the appropriate drawing area rect = [tabBar bounds]; - // find active cell + // Find active cell PSMTabBarCell *selectedCell = nil; + for (PSMTabBarCell *aCell in [tabBar cells]) { if (aCell.tabState & PSMTab_SelectedMask) { selectedCell = aCell; break; } } - - + [NSGraphicsContext saveGraphicsState]; [[NSGraphicsContext currentContext] setShouldAntialias:NO]; @@ -465,22 +472,14 @@ typedef struct { shadowAlpha = 0.3f; } - // fill in background of tab bar + // Fill in background of tab bar [[NSColor colorWithCalibratedWhite:backgroundCalibratedWhite alpha:1.0f] set]; - NSRectFill(NSMakeRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height - 10)); - - - // fill active tab strip - [[self fillColorForCell:selectedCell] set]; - NSRectFill(NSMakeRect(rect.origin.x, rect.origin.y + rect.size.height - 9, rect.size.width, 8)); + NSRectFill(NSMakeRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)); // Draw horizontal line across the top edge [[NSColor colorWithCalibratedWhite:lineCalibratedWhite alpha:1.0f] set]; [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x, rect.origin.y + 0.5f) toPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y + 0.5f)]; - // Draw horizontal line across the baseline for each tab - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x, rect.origin.y + rect.size.height - 9.5f) toPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height - 9.5f)]; - // Draw horizontal line across the bottom edge [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x, rect.origin.y + rect.size.height - 0.5f) toPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height - 0.5f)]; @@ -490,51 +489,27 @@ typedef struct { // Step 3 - (void)drawTabCell:(PSMTabBarCell *)cell { - // don't draw cells when collapsed - if (tabBar.isTabBarHidden) { - return; - } - - NSRect cellFrame = cell.frame; - NSColor *lineColor = nil; + // Don't draw cells when collapsed + if ([tabBar isTabBarHidden]) return; + + NSColor *lineColor = [self _lineColorForTabCellDrawing]; NSColor *fillColor = [self fillColorForCell:cell]; - // Set up colours - if (([[tabBar window] isMainWindow] || [[[tabBar window] attachedSheet] isMainWindow]) && [NSApp isActive]) { - lineColor = [NSColor grayColor]; - - } else { - lineColor = [NSColor colorWithCalibratedWhite:0.49f alpha:1.0f]; - - } - - // setup fill rect - NSRect fillRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y + 1, cellFrame.size.width, cellFrame.size.height - 10); - + [self _drawTabCell:cell withBackgroundColor:fillColor lineColor:lineColor]; - // draw - [NSGraphicsContext saveGraphicsState]; + [self drawInteriorWithTabCell:cell inView:[cell customControlView]]; +} - [fillColor set]; - NSRectFill(fillRect); - - // stroke left edge - [lineColor setStroke]; - NSPoint point1 = NSMakePoint(fillRect.origin.x + fillRect.size.width - 0.5, fillRect.origin.y); - NSPoint point2 = NSMakePoint(fillRect.origin.x + fillRect.size.width - 0.5, fillRect.origin.y + fillRect.size.height); - [NSBezierPath strokeLineFromPoint:point1 toPoint:point2]; - - // stroke bottom edge unless active cell - if (cell.state != NSOnState) { - point1 = NSMakePoint(fillRect.origin.x, fillRect.origin.y + fillRect.size.height - 0.5); - point2 = NSMakePoint(fillRect.origin.x + fillRect.size.width, fillRect.origin.y + fillRect.size.height - 0.5); - [NSBezierPath strokeLineFromPoint:point1 toPoint:point2]; - } +/** + * Same as above, but doesn't draw the left hand (right had of the actual tab) border for the tab drag image. + */ +- (void)drawTabCellForDragImage:(PSMTabBarCell *)cell +{ + NSColor *fillColor = [self fillColorForCell:cell]; - [NSGraphicsContext restoreGraphicsState]; - - [self drawInteriorWithTabCell:cell inView:[cell customControlView]]; + [self _drawTabCell:cell withBackgroundColor:fillColor lineColor:nil]; + [self drawInteriorWithTabCell:cell inView:[cell customControlView]]; } // Step 4 @@ -547,13 +522,21 @@ typedef struct { if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed] && [cell isHighlighted]) { NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage * closeButton = nil; + NSImage *closeButton = nil; closeButton = [cell isEdited] ? sequelProCloseDirtyButton : sequelProCloseButton; if ([cell closeButtonOver]) closeButton = [cell isEdited] ? sequelProCloseDirtyButtonOver : sequelProCloseButtonOver; if ([cell closeButtonPressed]) closeButton = [cell isEdited] ? sequelProCloseDirtyButtonDown : sequelProCloseButtonDown; + // Slightly darken background tabs on mouse over + if ([cell state] == NSOffState) { + NSColor *lineColor = [self _lineColorForTabCellDrawing]; + NSColor *fillColor = [[self fillColorForCell:cell] shadowWithLevel:0.03f]; + + [self _drawTabCell:cell withBackgroundColor:fillColor lineColor:lineColor]; + } + [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; } @@ -677,42 +660,55 @@ typedef struct { - (void)encodeWithCoder:(NSCoder *)aCoder { - //[super encodeWithCoder:aCoder]; -/* - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:sequelProCloseButton forKey:@"sequelProCloseButton"]; - [aCoder encodeObject:sequelProCloseButtonDown forKey:@"sequelProCloseButtonDown"]; - [aCoder encodeObject:sequelProCloseButtonOver forKey:@"sequelProCloseButtonOver"]; - [aCoder encodeObject:sequelProCloseDirtyButton forKey:@"sequelProCloseDirtyButton"]; - [aCoder encodeObject:sequelProCloseDirtyButtonDown forKey:@"sequelProCloseDirtyButtonDown"]; - [aCoder encodeObject:sequelProCloseDirtyButtonOver forKey:@"sequelProCloseDirtyButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } -*/ } - (id)initWithCoder:(NSCoder *)aDecoder { - self = [self init]; - if (self) { - -/* - if ([aDecoder allowsKeyedCoding]) { - sequelProCloseButton = [[aDecoder decodeObjectForKey:@"sequelProCloseButton"] retain]; - sequelProCloseButtonDown = [[aDecoder decodeObjectForKey:@"sequelProCloseButtonDown"] retain]; - sequelProCloseButtonOver = [[aDecoder decodeObjectForKey:@"sequelProCloseButtonOver"] retain]; - sequelProCloseDirtyButton = [[aDecoder decodeObjectForKey:@"sequelProCloseDirtyButton"] retain]; - sequelProCloseDirtyButtonDown = [[aDecoder decodeObjectForKey:@"sequelProCloseDirtyButtonDown"] retain]; - sequelProCloseDirtyButtonOver = [[aDecoder decodeObjectForKey:@"sequelProCloseDirtyButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - } -*/ - } - return self; + return [self init]; +} + +#pragma mark - +#pragma mark Private API + +- (void)_drawTabCell:(PSMTabBarCell *)cell withBackgroundColor:(NSColor *)backgroundColor lineColor:(NSColor *)lineColor +{ + NSRect cellFrame = [cell frame]; + + // Setup fill rect + NSRect fillRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y + 1, cellFrame.size.width, cellFrame.size.height - 1.5); + + // Draw + [NSGraphicsContext saveGraphicsState]; + + [backgroundColor set]; + NSRectFill(fillRect); + + if (lineColor) { + + // Stroke left edge + [lineColor setStroke]; + + NSPoint point1 = NSMakePoint(fillRect.origin.x + fillRect.size.width - 0.5, fillRect.origin.y); + NSPoint point2 = NSMakePoint(fillRect.origin.x + fillRect.size.width - 0.5, fillRect.origin.y + fillRect.size.height); + + [NSBezierPath strokeLineFromPoint:point1 toPoint:point2]; + } + + [NSGraphicsContext restoreGraphicsState]; +} + +- (NSColor *)_lineColorForTabCellDrawing +{ + NSColor *lineColor = nil; + + if (([[tabBar window] isMainWindow] || [[[tabBar window] attachedSheet] isMainWindow]) && [NSApp isActive]) { + lineColor = [NSColor grayColor]; + } + else { + lineColor = [NSColor colorWithCalibratedWhite:0.49f alpha:1.0f]; + } + + return lineColor; } @end diff --git a/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.h b/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.h deleted file mode 100644 index d44bbcdc..00000000 --- a/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// PSMUnifiedTabStyle.h -// -------------------- -// -// Created by Keith Blount on 30/04/2006. -// Copyright 2006 __MyCompanyName__. All rights reserved. -// - -#import <Cocoa/Cocoa.h> -#import "PSMTabStyle.h" - -@interface PSMUnifiedTabStyle : NSObject <PSMTabStyle> -{ - NSImage *unifiedCloseButton; - NSImage *unifiedCloseButtonDown; - NSImage *unifiedCloseButtonOver; - NSImage *unifiedCloseDirtyButton; - NSImage *unifiedCloseDirtyButtonDown; - NSImage *unifiedCloseDirtyButtonOver; - NSImage *_addTabButtonImage; - NSImage *_addTabButtonPressedImage; - NSImage *_addTabButtonRolloverImage; - - NSDictionary *_objectCountStringAttributes; - - CGFloat leftMargin; - PSMTabBarControl *tabBar; -} -- (void)setLeftMarginForTabBarControl:(CGFloat)margin; -@end diff --git a/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m deleted file mode 100644 index 882c1741..00000000 --- a/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m +++ /dev/null @@ -1,598 +0,0 @@ -// -// PSMUnifiedTabStyle.m -// -------------------- -// -// Created by Keith Blount on 30/04/2006. -// Copyright 2006 __MyCompanyName__. All rights reserved. -// - -#import "PSMUnifiedTabStyle.h" -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" -#import "NSBezierPath_AMShading.h" - -#define kPSMUnifiedObjectCounterRadius 7.0 -#define kPSMUnifiedCounterMinWidth 20 - -@interface PSMUnifiedTabStyle (Private) -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; -@end - -@implementation PSMUnifiedTabStyle - -- (NSString *)name -{ - return @"Unified"; -} - -#pragma mark - -#pragma mark Creation/Destruction - -- (id) init -{ - if ( (self = [super init]) ) { - unifiedCloseButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front"]]; - unifiedCloseButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Pressed"]]; - unifiedCloseButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Rollover"]]; - - unifiedCloseDirtyButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front"]]; - unifiedCloseDirtyButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front_Pressed"]]; - unifiedCloseDirtyButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabCloseDirty_Front_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNew"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewRollover"]]; - - _objectCountStringAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:[[NSFontManager sharedFontManager] convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask], NSFontAttributeName, - [[NSColor whiteColor] colorWithAlphaComponent:0.85], NSForegroundColorAttributeName, - nil, nil]; - - leftMargin = 5.0; - } - return self; -} - -- (void)dealloc -{ - [unifiedCloseButton release]; - [unifiedCloseButtonDown release]; - [unifiedCloseButtonOver release]; - [unifiedCloseDirtyButton release]; - [unifiedCloseDirtyButtonDown release]; - [unifiedCloseDirtyButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - - [_objectCountStringAttributes release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Control Specific - -- (void)setLeftMarginForTabBarControl:(CGFloat)margin -{ - leftMargin = margin; -} - -- (CGFloat)leftMarginForTabBarControl -{ - return leftMargin; -} - -- (CGFloat)rightMarginForTabBarControl -{ - return 24.0f; -} - -- (CGFloat)topMarginForTabBarControl -{ - return 10.0f; -} - -- (void)setOrientation:(PSMTabBarOrientation)value -{ - -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect)dragRectForTabCell:(PSMTabBarCell *)cell orientation:(PSMTabBarOrientation)orientation -{ - NSRect dragRect = [cell frame]; - dragRect.size.width++; - return dragRect; -} - -- (NSRect)closeButtonRectForTabCell:(PSMTabBarCell *)cell withFrame:(NSRect)cellFrame -{ - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [unifiedCloseButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y - 1.0; - - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - result.origin.x += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y - 1.0; - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - CGFloat countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMUnifiedObjectCounterRadius - 6.0); - if (countWidth < kPSMUnifiedCounterMinWidth) { - countWidth = kPSMUnifiedCounterMinWidth; - } - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMUnifiedObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if (![[cell indicator] isHidden]) { - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - } - - return result; -} - - -- (CGFloat)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - CGFloat resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - resultWidth += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - } - - // icon? - if ([cell hasIcon]) { - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - } - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if ([cell count] > 0) { - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - } - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (CGFloat)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - CGFloat resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if ([cell hasIcon]) { - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - } - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if ([cell count] > 0) { - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - } - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (CGFloat)tabCellHeight -{ - return kPSMTabBarControlHeight; -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSString *contents = [NSString stringWithFormat:@"%lu", (unsigned long)[cell count]]; - return [[[NSMutableAttributedString alloc] initWithString:contents attributes:_objectCountStringAttributes] autorelease]; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString * contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - - // Paragraph Style for Truncating Long Text - static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; - if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:TruncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - NSToolbar *toolbar = [[[cell customControlView] window] toolbar]; - BOOL showsBaselineSeparator = (toolbar && [toolbar respondsToSelector:@selector(showsBaselineSeparator)] && [toolbar showsBaselineSeparator]); - if (!showsBaselineSeparator) { - cellFrame.origin.y += 1.0; - cellFrame.size.height -= 1.0; - } - - NSColor * lineColor = nil; - NSBezierPath* bezier = [NSBezierPath bezierPath]; - lineColor = [NSColor colorWithCalibratedWhite:0.576 alpha:1.0]; - - if (!showsBaselineSeparator || [cell state] == NSOnState) - { - // selected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x+0.5, cellFrame.origin.y-0.5, cellFrame.size.width, cellFrame.size.height); - - // frame - CGFloat radius = MIN(6.0, 0.5f * MIN(NSWidth(aRect), NSHeight(aRect))); - NSRect rect = NSInsetRect(aRect, radius, radius); - - [bezier appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMinY(rect)) radius:radius startAngle:180.0 endAngle:270.0]; - - [bezier appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMinY(rect)) radius:radius startAngle:270.0 endAngle:360.0]; - - NSPoint cornerPoint = NSMakePoint(NSMaxX(aRect), NSMaxY(aRect)); - [bezier appendBezierPathWithPoints:&cornerPoint count:1]; - - cornerPoint = NSMakePoint(NSMinX(aRect), NSMaxY(aRect)); - [bezier appendBezierPathWithPoints:&cornerPoint count:1]; - - [bezier closePath]; - - //[[NSColor windowBackgroundColor] set]; - //[bezier fill]; - if ([NSApp isActive]) { - if ([cell state] == NSOnState) { - [bezier linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.99 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.941 alpha:1.0]]; - } else if ([cell isHighlighted]) { - [bezier linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.80 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.80 alpha:1.0]]; - } else { - [bezier linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]]; - } - } - - [lineColor set]; - [bezier stroke]; - } - else - { - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - aRect.origin.y += 0.5; - aRect.origin.x += 1.5; - aRect.size.width -= 1; - - aRect.origin.x -= 1; - aRect.size.width += 1; - - // rollover - if ([cell isHighlighted]) - { - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositeSourceAtop); - } - - // frame - - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y-0.5)]; - if (!([cell tabState] & PSMTab_RightIsSelectedMask)) { - [bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect))]; - } - - [bezier stroke]; - - // Create a thin lighter line next to the dividing line for a bezel effect - if (!([cell tabState] & PSMTab_RightIsSelectedMask)) { - [[[NSColor whiteColor] colorWithAlphaComponent:0.5] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(NSMaxX(aRect)+1.0, aRect.origin.y-0.5) - toPoint:NSMakePoint(NSMaxX(aRect)+1.0, NSMaxY(aRect)-2.5)]; - } - - // If this is the leftmost tab, we want to draw a line on the left, too - if ([cell tabState] & PSMTab_PositionLeftMask) - { - [lineColor set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(aRect.origin.x,aRect.origin.y-0.5) - toPoint:NSMakePoint(aRect.origin.x,NSMaxY(aRect)-2.5)]; - [[[NSColor whiteColor] colorWithAlphaComponent:0.5] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(aRect.origin.x+1.0,aRect.origin.y-0.5) - toPoint:NSMakePoint(aRect.origin.x+1.0,NSMaxY(aRect)-2.5)]; - } - } - - [self drawInteriorWithTabCell:cell inView:[cell customControlView]]; -} - - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - CGFloat labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage * closeButton = nil; - - closeButton = [cell isEdited] ? unifiedCloseDirtyButton : unifiedCloseButton; - - if ([cell closeButtonOver]) closeButton = [cell isEdited] ? unifiedCloseDirtyButtonOver : unifiedCloseButtonOver; - if ([cell closeButtonPressed]) closeButton = [cell isEdited] ? unifiedCloseDirtyButtonDown : unifiedCloseButtonDown; - - closeButtonSize = [closeButton size]; - - [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; - } - - // icon - if ([cell hasIcon]) { - NSRect iconRect = [self iconRectForTabCell:cell]; - NSImage *icon = [[[cell representedObject] identifier] icon]; - - // center in available space (in case icon image is smaller than kPSMTabBarIconWidth) - if ([icon size].width < kPSMTabBarIconWidth) { - iconRect.origin.x += (kPSMTabBarIconWidth - [icon size].width) / 2.0; - } - if ([icon size].height < kPSMTabBarIconWidth) { - iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height) / 2.0; - } - - [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += iconRect.size.width + kPSMTabBarCellPadding; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - NSSize s = [[cell attributedStringValue] size]; - labelRect.origin.y = cellFrame.origin.y + (cellFrame.size.height-s.height) / 2.0 - 1.0; - labelRect.size.height = s.height; - - if (![[cell indicator] isHidden]) { - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - } - - // object counter - if ([cell count] > 0) { - [[cell countColor] ?: [NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - myRect.origin.y -= 1.0; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMUnifiedObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMUnifiedObjectCounterRadius, myRect.origin.y + kPSMUnifiedObjectCounterRadius) radius:kPSMUnifiedObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y + kPSMUnifiedObjectCounterRadius) radius:kPSMUnifiedObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - - labelRect.size.width -= myRect.size.width + kPSMTabBarCellPadding; - } - - // label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawBackgroundInRect:(NSRect)rect -{ - //Draw for our whole bounds; it'll be automatically clipped to fit the appropriate drawing area - rect = [tabBar bounds]; - - NSRect gradientRect = rect; - gradientRect.size.height -= 1.0; - - NSBezierPath *path = [NSBezierPath bezierPathWithRect:gradientRect]; - [path linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]]; - [[NSColor colorWithCalibratedWhite:0.576 alpha:1.0] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x, NSMaxY(rect) - 0.5) - toPoint:NSMakePoint(NSMaxX(rect), NSMaxY(rect) - 0.5)]; - - if (![[[tabBar tabView] window] isKeyWindow]) { - [[NSColor windowBackgroundColor] set]; - NSRectFill(gradientRect); - } -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - tabBar = bar; - [self drawBackgroundInRect:rect]; - - // no tab view == not connected - if (![bar tabView]) { - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - NSMutableParagraphStyle *centeredParagraphStyle = nil; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [centeredParagraphStyle release]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while ( (cell = [e nextObject]) ) { - if ([bar isAnimating] || (![cell isInOverflowMenu] && NSIntersectsRect([cell frame], rect))) { - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ -/* - //[super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:unifiedCloseButton forKey:@"unifiedCloseButton"]; - [aCoder encodeObject:unifiedCloseButtonDown forKey:@"unifiedCloseButtonDown"]; - [aCoder encodeObject:unifiedCloseButtonOver forKey:@"unifiedCloseButtonOver"]; - [aCoder encodeObject:unifiedCloseDirtyButton forKey:@"unifiedCloseDirtyButton"]; - [aCoder encodeObject:unifiedCloseDirtyButtonDown forKey:@"unifiedCloseDirtyButtonDown"]; - [aCoder encodeObject:unifiedCloseDirtyButtonOver forKey:@"unifiedCloseDirtyButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } -*/ -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - self = [self init]; - if (self) { - /* - if ([aDecoder allowsKeyedCoding]) { - unifiedCloseButton = [[aDecoder decodeObjectForKey:@"unifiedCloseButton"] retain]; - unifiedCloseButtonDown = [[aDecoder decodeObjectForKey:@"unifiedCloseButtonDown"] retain]; - unifiedCloseButtonOver = [[aDecoder decodeObjectForKey:@"unifiedCloseButtonOver"] retain]; - unifiedCloseDirtyButton = [[aDecoder decodeObjectForKey:@"unifiedCloseDirtyButton"] retain]; - unifiedCloseDirtyButtonDown = [[aDecoder decodeObjectForKey:@"unifiedCloseDirtyButtonDown"] retain]; - unifiedCloseDirtyButtonOver = [[aDecoder decodeObjectForKey:@"unifiedCloseDirtyButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - } - */ - } - return self; -} - -@end diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 05c769e3..e401ea97 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -1,10 +1,11 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> <dependencies> <deployment identifier="macosx"/> - <development version="5100" identifier="xcode"/> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/> - <plugIn identifier="com.apple.WebKitIBPlugin" version="10117"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/> + <plugIn identifier="com.apple.WebKitIBPlugin" version="11762"/> + <capability name="box content view" minToolsVersion="7.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="SPDatabaseDocument"> @@ -104,7 +105,7 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="sourceList" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" id="6685"> - <rect key="frame" x="0.0" y="0.0" width="218" height="19"/> + <rect key="frame" x="0.0" y="0.0" width="218" height="38"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="_sourceListBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -165,7 +166,7 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <tableView identifier="TablesListTableView" focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="sequential" selectionHighlightStyle="sourceList" columnReordering="NO" autosaveColumns="NO" id="22" customClass="SPTableView"> - <rect key="frame" x="0.0" y="0.0" width="214" height="19"/> + <rect key="frame" x="0.0" y="0.0" width="214" height="334"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="_sourceListBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -231,7 +232,7 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="sequential" selectionHighlightStyle="sourceList" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="45" id="7692" userLabel="Table View (Activities)"> - <rect key="frame" x="0.0" y="0.0" width="216" height="47"/> + <rect key="frame" x="0.0" y="0.0" width="216" height="166"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="_sourceListBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -276,7 +277,7 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="sequential" selectionHighlightStyle="sourceList" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" id="4484"> - <rect key="frame" x="0.0" y="0.0" width="214" height="19"/> + <rect key="frame" x="0.0" y="0.0" width="214" height="166"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="_sourceListBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -464,25 +465,25 @@ <rect key="frame" x="215" y="0.0" width="728" height="549"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <tabView controlSize="small" type="rightTabsBezelBorder" initialItem="28" id="25"> - <rect key="frame" x="-7" y="-10" width="741" height="564"/> + <tabView misplaced="YES" controlSize="small" type="rightTabsBezelBorder" initialItem="28" id="25"> + <rect key="frame" x="-7" y="-10" width="741" height="566"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <tabViewItems> <tabViewItem label="Structure" identifier="source" id="28"> <view key="view" identifier="StructureTabView" id="29"> - <rect key="frame" x="10" y="7" width="706" height="544"/> + <rect key="frame" x="10" y="7" width="702" height="546"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <splitView dividerStyle="thin" id="674"> - <rect key="frame" x="7" y="10" width="695" height="530"/> + <rect key="frame" x="7" y="10" width="691" height="532"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <customView identifier="TableStructureColumnsView" id="673"> - <rect key="frame" x="0.0" y="0.0" width="695" height="328"/> + <rect key="frame" x="0.0" y="0.0" width="691" height="329"/> <autoresizingMask key="autoresizingMask"/> <subviews> <button toolTip="Edit Table Details (⌘4)" id="6009"> - <rect key="frame" x="632" y="-1" width="32" height="25"/> + <rect key="frame" x="628" y="-1" width="32" height="25"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="button_edit" imagePosition="overlaps" alignment="center" enabled="NO" state="on" inset="2" id="6010"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> @@ -495,12 +496,12 @@ </connections> </button> <imageView id="5129"> - <rect key="frame" x="-1" y="0.0" width="692" height="23"/> + <rect key="frame" x="-1" y="0.0" width="688" height="23"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="button_bar_spacer" id="5130"/> </imageView> <popUpButton id="8025"> - <rect key="frame" x="663" y="0.0" width="36" height="23"/> + <rect key="frame" x="659" y="0.0" width="36" height="23"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> <popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" imagePosition="right" alignment="center" lineBreakMode="truncatingTail" state="on" inset="2" pullsDown="YES" arrowPosition="noArrow" selectedItem="8028" id="8026"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> @@ -595,14 +596,14 @@ </connections> </button> <scrollView focusRingType="none" autohidesScrollers="YES" horizontalLineScroll="18" horizontalPageScroll="10" verticalLineScroll="18" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="231"> - <rect key="frame" x="-1" y="22" width="696" height="306"/> + <rect key="frame" x="-1" y="22" width="692" height="307"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="07n-i9-O0i"> - <rect key="frame" x="1" y="23" width="694" height="282"/> + <rect key="frame" x="1" y="0.0" width="690" height="306"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <tableView identifier="TableStructureColumnsTableView" focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveName="SPTableStructureSource" rowHeight="16" headerView="3926" id="232" customClass="SPTableView"> - <rect key="frame" x="0.0" y="0.0" width="688" height="18"/> + <rect key="frame" x="0.0" y="0.0" width="690" height="283"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -799,7 +800,6 @@ </connections> </tableView> </subviews> - <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> </clipView> <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="3925"> <rect key="frame" x="1" y="289" width="690" height="16"/> @@ -810,7 +810,7 @@ <autoresizingMask key="autoresizingMask"/> </scroller> <tableHeaderView key="headerView" id="3926"> - <rect key="frame" x="0.0" y="0.0" width="692" height="23"/> + <rect key="frame" x="0.0" y="0.0" width="690" height="23"/> <autoresizingMask key="autoresizingMask"/> <connections> <outlet property="menu" destination="8056" id="Uxa-5O-Q0T"/> @@ -834,11 +834,11 @@ </subviews> </customView> <customView identifier="TableStructureIndexesView" id="672"> - <rect key="frame" x="0.0" y="329" width="695" height="201"/> + <rect key="frame" x="0.0" y="330" width="691" height="202"/> <autoresizingMask key="autoresizingMask"/> <subviews> <imageView id="5148"> - <rect key="frame" x="-1" y="0.0" width="692" height="23"/> + <rect key="frame" x="-1" y="0.0" width="688" height="23"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="button_bar_spacer" id="5149"/> </imageView> @@ -878,14 +878,14 @@ </connections> </button> <scrollView identifier="TableStructureIndexesTableScrollView" focusRingType="none" autohidesScrollers="YES" horizontalLineScroll="18" horizontalPageScroll="10" verticalLineScroll="18" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="287"> - <rect key="frame" x="-1" y="22" width="696" height="159"/> + <rect key="frame" x="-1" y="22" width="692" height="160"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="N3x-Gt-GZH"> - <rect key="frame" x="1" y="23" width="694" height="135"/> + <rect key="frame" x="1" y="0.0" width="690" height="159"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <tableView identifier="TableStructureIndexesTableView" focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="16" headerView="3923" id="289" customClass="SPTableView"> - <rect key="frame" x="0.0" y="0.0" width="690" height="18"/> + <rect key="frame" x="0.0" y="0.0" width="690" height="136"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -1016,10 +1016,9 @@ </connections> </tableView> </subviews> - <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> </clipView> <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="3922"> - <rect key="frame" x="1" y="142" width="690" height="16"/> + <rect key="frame" x="1" y="143" width="690" height="16"/> <autoresizingMask key="autoresizingMask"/> </scroller> <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="3921"> @@ -1027,12 +1026,12 @@ <autoresizingMask key="autoresizingMask"/> </scroller> <tableHeaderView key="headerView" id="3923"> - <rect key="frame" x="0.0" y="0.0" width="694" height="23"/> + <rect key="frame" x="0.0" y="0.0" width="690" height="23"/> <autoresizingMask key="autoresizingMask"/> </tableHeaderView> </scrollView> <view id="6024"> - <rect key="frame" x="0.0" y="181" width="695" height="20"/> + <rect key="frame" x="0.0" y="182" width="691" height="20"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <subviews> <textField verticalHuggingPriority="750" id="6027"> @@ -1045,7 +1044,7 @@ </textFieldCell> </textField> <imageView id="4503"> - <rect key="frame" x="678" y="3" width="10" height="13"/> + <rect key="frame" x="674" y="3" width="10" height="13"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/> <imageCell key="cell" refusesFirstResponder="YES" alignment="left" image="grabber-horizontal" id="4504"/> </imageView> @@ -1194,7 +1193,7 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="kdv-Wp-s5h"> <rect key="frame" x="0.0" y="0.0" width="607" height="27"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <autoresizingMask key="autoresizingMask"/> <subviews> <ruleEditor nestingMode="compound" canRemoveAllRows="YES" rowHeight="25" id="FF9-z2-9od"> <rect key="frame" x="0.0" y="0.0" width="607" height="27"/> @@ -1358,11 +1357,11 @@ <rect key="frame" x="-1" y="-2" width="696" height="450"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="lwO-LP-RWZ"> - <rect key="frame" x="1" y="23" width="694" height="426"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <rect key="frame" x="1" y="0.0" width="694" height="449"/> + <autoresizingMask key="autoresizingMask"/> <subviews> <tableView identifier="TableContentTableView" focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" alternatingRowBackgroundColors="YES" autosaveColumns="NO" rowHeight="16" headerView="3920" id="36" customClass="SPCopyTable"> - <rect key="frame" x="0.0" y="0.0" width="626" height="18"/> + <rect key="frame" x="0.0" y="0.0" width="694" height="426"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -1389,7 +1388,6 @@ </connections> </tableView> </subviews> - <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> </clipView> <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="0.021626397967338562" horizontal="YES" id="3919"> <rect key="frame" x="1" y="458" width="429" height="15"/> @@ -1420,7 +1418,7 @@ </tabViewItem> <tabViewItem label="Custom Query" identifier="customQuery" id="119"> <view key="view" identifier="QueryTabView" id="120"> - <rect key="frame" x="10" y="7" width="706" height="544"/> + <rect key="frame" x="10" y="7" width="706" height="546"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <imageView id="7965"> @@ -1488,37 +1486,35 @@ </connections> </button> <splitView dividerStyle="thin" id="7206" customClass="SPSplitView"> - <rect key="frame" x="6" y="33" width="696" height="509"/> + <rect key="frame" x="6" y="33" width="696" height="511"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <view id="7207"> <rect key="frame" x="0.0" y="0.0" width="696" height="391"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <splitView id="7209" customClass="SPSplitView"> - <rect key="frame" x="0.0" y="0.0" width="696" height="389"/> + <splitView misplaced="YES" id="7209" customClass="SPSplitView"> + <rect key="frame" x="0.0" y="0.0" width="696" height="387"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <customView id="7210"> - <rect key="frame" x="0.0" y="0.0" width="696" height="143"/> + <rect key="frame" x="0.0" y="0.0" width="696" height="142"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <scrollView focusRingType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="8251"> - <rect key="frame" x="0.0" y="1" width="696" height="143"/> + <rect key="frame" x="0.0" y="1" width="696" height="142"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="npE-bg-ppa"> - <rect key="frame" x="1" y="1" width="694" height="141"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <rect key="frame" x="1" y="1" width="694" height="140"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView focusRingType="none" importsGraphics="NO" richText="NO" horizontallyResizable="YES" findStyle="panel" allowsDocumentBackgroundColorChange="YES" allowsUndo="YES" usesRuler="YES" usesFontPanel="YES" verticallyResizable="YES" id="8254" customClass="SPTextView"> - <rect key="frame" x="0.0" y="0.0" width="694" height="141"/> + <textView focusRingType="none" importsGraphics="NO" richText="NO" horizontallyResizable="YES" usesFontPanel="YES" findStyle="panel" allowsDocumentBackgroundColorChange="YES" allowsUndo="YES" usesRuler="YES" id="8254" customClass="SPTextView"> + <rect key="frame" x="0.0" y="0.0" width="694" height="140"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <size key="minSize" width="694" height="141"/> + <size key="minSize" width="694" height="140"/> <size key="maxSize" width="100000" height="10000000"/> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="694" height="141"/> - <size key="maxSize" width="100000" height="10000000"/> <connections> <binding destination="1907" name="textColor" keyPath="values.CustomQueryEditorTextColor" id="8258"> <dictionary key="options"> @@ -1540,23 +1536,23 @@ <autoresizingMask key="autoresizingMask"/> </scroller> <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="8252"> - <rect key="frame" x="224" y="1" width="15" height="133"/> + <rect key="frame" x="679" y="1" width="16" height="140"/> <autoresizingMask key="autoresizingMask"/> </scroller> </scrollView> </subviews> </customView> <customView id="7211"> - <rect key="frame" x="0.0" y="152" width="696" height="237"/> + <rect key="frame" x="0.0" y="151" width="696" height="236"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <imageView id="7222"> - <rect key="frame" x="0.0" y="214" width="696" height="23"/> + <rect key="frame" x="0.0" y="213" width="696" height="23"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="button_bar_spacer" id="7230"/> </imageView> <popUpButton id="7221"> - <rect key="frame" x="0.0" y="214" width="35" height="23"/> + <rect key="frame" x="0.0" y="213" width="35" height="23"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" imagePosition="right" alignment="center" lineBreakMode="truncatingTail" inset="2" pullsDown="YES" arrowPosition="noArrow" autoenablesItems="NO" selectedItem="7236" id="7231"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> @@ -1691,7 +1687,7 @@ Gw </popUpButtonCell> </popUpButton> <popUpButton toolTip="Choose a favorite from the menu or save queries to the favorites (⌥⌘F)" verticalHuggingPriority="750" id="7218"> - <rect key="frame" x="38" y="214" width="129" height="22"/> + <rect key="frame" x="38" y="213" width="129" height="22"/> <autoresizingMask key="autoresizingMask" flexibleMinY="YES"/> <popUpButtonCell key="cell" type="recessed" title="Query Favorites" bezelStyle="recessed" alignment="center" controlSize="small" lineBreakMode="clipping" borderStyle="borderAndBezel" inset="2" pullsDown="YES" preferredEdge="maxY" selectedItem="7264" id="7262"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/> @@ -1727,7 +1723,7 @@ Gw </connections> </popUpButton> <popUpButton toolTip="Choose a query from your recent queries (⌥⌘Y)" verticalHuggingPriority="750" id="7217"> - <rect key="frame" x="177" y="214" width="145" height="22"/> + <rect key="frame" x="177" y="213" width="145" height="22"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <popUpButtonCell key="cell" type="recessed" title="Query History" bezelStyle="recessed" alignment="center" controlSize="small" lineBreakMode="clipping" borderStyle="borderAndBezel" inset="2" pullsDown="YES" preferredEdge="maxY" selectedItem="7273" id="7271"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/> @@ -1779,14 +1775,14 @@ Gw </connections> </popUpButton> <scrollView focusRingType="none" autohidesScrollers="YES" horizontalLineScroll="18" horizontalPageScroll="10" verticalLineScroll="18" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="7223"> - <rect key="frame" x="0.0" y="-1" width="696" height="215"/> + <rect key="frame" x="0.0" y="-1" width="696" height="214"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="NVV-XL-mVZ"> - <rect key="frame" x="1" y="23" width="694" height="191"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <rect key="frame" x="1" y="0.0" width="694" height="213"/> + <autoresizingMask key="autoresizingMask"/> <subviews> <tableView identifier="CustomQueryResultsTableView" focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" autosaveColumns="NO" rowHeight="16" headerView="7227" id="7224" customClass="SPCopyTable"> - <rect key="frame" x="0.0" y="0.0" width="694" height="191"/> + <rect key="frame" x="0.0" y="0.0" width="694" height="190"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -1813,7 +1809,6 @@ Gw </connections> </tableView> </subviews> - <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> </clipView> <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="7226"> <rect key="frame" x="1" y="199" width="693" height="15"/> @@ -1829,7 +1824,7 @@ Gw </tableHeaderView> </scrollView> <popUpButton verticalHuggingPriority="750" id="8316" customClass="SPComboPopupButton"> - <rect key="frame" x="508" y="214" width="180" height="22"/> + <rect key="frame" x="508" y="213" width="180" height="22"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/> <popUpButtonCell key="cell" type="roundRect" title="Run Current" bezelStyle="roundedRect" alignment="center" controlSize="small" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" pullsDown="YES" selectedItem="8319" id="8317" customClass="SPComboPopupButtonCell"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> @@ -1875,11 +1870,11 @@ Gw </subviews> </view> <view id="7208"> - <rect key="frame" x="0.0" y="392" width="696" height="117"/> + <rect key="frame" x="0.0" y="392" width="696" height="119"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <textField verticalHuggingPriority="750" id="7429"> - <rect key="frame" x="15" y="91" width="363" height="14"/> + <rect key="frame" x="15" y="93" width="363" height="14"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Query Status" id="7430"> <font key="font" metaFont="smallSystemBold"/> @@ -1888,21 +1883,19 @@ Gw </textFieldCell> </textField> <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="8245"> - <rect key="frame" x="12" y="12" width="672" height="72"/> + <rect key="frame" x="12" y="12" width="672" height="74"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="Nr9-eI-xLJ"> - <rect key="frame" x="0.0" y="0.0" width="672" height="72"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <rect key="frame" x="0.0" y="0.0" width="672" height="74"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView editable="NO" drawsBackground="NO" importsGraphics="NO" horizontallyResizable="YES" usesFontPanel="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" id="8248"> - <rect key="frame" x="0.0" y="0.0" width="672" height="72"/> + <textView editable="NO" drawsBackground="NO" importsGraphics="NO" horizontallyResizable="YES" usesFontPanel="YES" allowsNonContiguousLayout="YES" id="8248"> + <rect key="frame" x="0.0" y="0.0" width="672" height="74"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <size key="minSize" width="672" height="72"/> + <size key="minSize" width="672" height="74"/> <size key="maxSize" width="887" height="10000000"/> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="672" height="72"/> - <size key="maxSize" width="887" height="10000000"/> </textView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> @@ -1967,17 +1960,15 @@ Gw <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="fhZ-nZ-AwI"> <rect key="frame" x="1" y="1" width="552" height="70"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView importsGraphics="NO" richText="NO" findStyle="panel" continuousSpellChecking="YES" verticallyResizable="YES" smartInsertDelete="YES" id="8236"> + <textView importsGraphics="NO" richText="NO" findStyle="panel" continuousSpellChecking="YES" smartInsertDelete="YES" id="8236"> <rect key="frame" x="0.0" y="0.0" width="552" height="70"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <size key="minSize" width="552" height="70"/> <size key="maxSize" width="1097" height="10000000"/> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="552" height="70"/> - <size key="maxSize" width="1097" height="10000000"/> <connections> <outlet property="delegate" destination="1277" id="8237"/> </connections> @@ -2014,17 +2005,15 @@ Gw <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="nV8-ly-BSi"> <rect key="frame" x="1" y="1" width="552" height="197"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" id="8242" customClass="SPTextView"> + <textView editable="NO" importsGraphics="NO" richText="NO" id="8242" customClass="SPTextView"> <rect key="frame" x="0.0" y="0.0" width="552" height="197"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <size key="minSize" width="552" height="197"/> <size key="maxSize" width="1097" height="10000000"/> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="552" height="197"/> - <size key="maxSize" width="1097" height="10000000"/> <connections> <outlet property="delegate" destination="1277" id="8243"/> </connections> @@ -2130,19 +2119,13 @@ Gw <action selector="updateTableCollation:" target="1277" id="5840"/> </connections> </popUpButton> - <box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="5806"> + <box verticalHuggingPriority="750" boxType="separator" id="5806"> <rect key="frame" x="25" y="427" width="650" height="5"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> - <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> - <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> - <font key="titleFont" metaFont="system"/> </box> - <box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="5807"> + <box verticalHuggingPriority="750" boxType="separator" id="5807"> <rect key="frame" x="24" y="316" width="650" height="5"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> - <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> - <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> - <font key="titleFont" metaFont="system"/> </box> <textField verticalHuggingPriority="750" id="5775"> <rect key="frame" x="175" y="400" width="100" height="14"/> @@ -2350,11 +2333,11 @@ Gw <rect key="frame" x="6" y="32" width="696" height="474"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="EaV-iG-q8t"> - <rect key="frame" x="1" y="23" width="694" height="450"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <rect key="frame" x="1" y="0.0" width="694" height="473"/> + <autoresizingMask key="autoresizingMask"/> <subviews> <tableView identifier="TableRelationsTableView" focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" autosaveColumns="NO" rowHeight="16" headerView="5545" id="5548" customClass="SPCopyTable"> - <rect key="frame" x="0.0" y="0.0" width="694" height="18"/> + <rect key="frame" x="0.0" y="0.0" width="694" height="450"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -2459,7 +2442,6 @@ Gw </connections> </tableView> </subviews> - <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> </clipView> <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="5546"> <rect key="frame" x="1" y="470" width="688" height="15"/> @@ -2538,11 +2520,11 @@ Gw <rect key="frame" x="6" y="32" width="696" height="474"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="tlh-Sg-Saf"> - <rect key="frame" x="1" y="23" width="694" height="450"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <rect key="frame" x="1" y="0.0" width="694" height="473"/> + <autoresizingMask key="autoresizingMask"/> <subviews> <tableView identifier="TableTriggersTableView" focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" autosaveColumns="NO" rowHeight="16" headerView="6704" id="6701" customClass="SPCopyTable"> - <rect key="frame" x="0.0" y="0.0" width="693" height="18"/> + <rect key="frame" x="0.0" y="0.0" width="694" height="450"/> <autoresizingMask key="autoresizingMask"/> <size key="intercellSpacing" width="3" height="2"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -2647,7 +2629,6 @@ Gw </connections> </tableView> </subviews> - <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> </clipView> <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="6703"> <rect key="frame" x="1" y="457" width="694" height="16"/> @@ -3414,12 +3395,9 @@ Gw <outlet property="nextKeyView" destination="6834" id="6848"/> </connections> </textField> - <box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="6852"> + <box verticalHuggingPriority="750" boxType="separator" id="6852"> <rect key="frame" x="-3" y="92" width="306" height="5"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> - <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> - <font key="titleFont" metaFont="system"/> </box> </subviews> </view> @@ -3437,10 +3415,10 @@ Gw <rect key="frame" x="0.0" y="0.0" width="379" height="369"/> <autoresizingMask key="autoresizingMask"/> <subviews> - <box autoresizesSubviews="NO" title="Table:" borderType="line" id="5660"> + <box autoresizesSubviews="NO" borderType="line" title="Table:" id="5660"> <rect key="frame" x="17" y="231" width="345" height="56"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <view key="contentView"> + <view key="contentView" id="G3T-Zw-qVw"> <rect key="frame" x="1" y="1" width="343" height="40"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> @@ -3473,13 +3451,11 @@ Gw </textField> </subviews> </view> - <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> - <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> </box> - <box autoresizesSubviews="NO" title="Name" borderType="line" id="7798"> + <box autoresizesSubviews="NO" borderType="line" title="Name" id="7798"> <rect key="frame" x="17" y="291" width="345" height="58"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <view key="contentView"> + <view key="contentView" id="PBs-KU-8Dt"> <rect key="frame" x="1" y="1" width="343" height="42"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> @@ -3506,13 +3482,11 @@ Gw </textField> </subviews> </view> - <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> - <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> </box> - <box autoresizesSubviews="NO" title="Action" borderType="line" id="5659"> + <box autoresizesSubviews="NO" borderType="line" title="Action" id="5659"> <rect key="frame" x="17" y="49" width="345" height="87"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <view key="contentView"> + <view key="contentView" id="Z9B-3e-PSv"> <rect key="frame" x="1" y="1" width="343" height="71"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> @@ -3578,13 +3552,11 @@ Gw </textField> </subviews> </view> - <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> - <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> </box> - <box autoresizesSubviews="NO" title="References" borderType="line" id="5652"> + <box autoresizesSubviews="NO" borderType="line" title="References" id="5652"> <rect key="frame" x="17" y="140" width="345" height="87"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <view key="contentView"> + <view key="contentView" id="APb-Qe-OSq"> <rect key="frame" x="1" y="1" width="343" height="71"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> @@ -3641,8 +3613,6 @@ Gw </textField> </subviews> </view> - <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> - <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> </box> <button verticalHuggingPriority="750" tag="1" id="5599"> <rect key="frame" x="268" y="13" width="96" height="28"/> @@ -3702,10 +3672,10 @@ Gw <userLayoutGuide location="323" affinity="minX"/> </userGuides> <subviews> - <box autoresizesSubviews="NO" title="Trigger:" borderType="line" id="6770"> + <box autoresizesSubviews="NO" borderType="line" title="Trigger:" id="6770"> <rect key="frame" x="17" y="219" width="326" height="109"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> - <view key="contentView"> + <view key="contentView" id="Otf-WX-kyk"> <rect key="frame" x="1" y="1" width="324" height="93"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> @@ -3779,8 +3749,6 @@ Gw </textField> </subviews> </view> - <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> - <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> </box> <button verticalHuggingPriority="750" tag="1" id="6768"> <rect key="frame" x="249" y="13" width="96" height="28"/> @@ -3814,17 +3782,15 @@ DQ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="ouK-7i-Xtd"> <rect key="frame" x="1" y="1" width="318" height="168"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView importsGraphics="NO" richText="NO" findStyle="panel" allowsUndo="YES" usesFontPanel="YES" verticallyResizable="YES" smartInsertDelete="YES" id="8230" customClass="SPTextView"> + <textView importsGraphics="NO" richText="NO" usesFontPanel="YES" findStyle="panel" allowsUndo="YES" smartInsertDelete="YES" id="8230" customClass="SPTextView"> <rect key="frame" x="0.0" y="0.0" width="318" height="168"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <size key="minSize" width="318" height="168"/> <size key="maxSize" width="592" height="10000000"/> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="318" height="168"/> - <size key="maxSize" width="592" height="10000000"/> <connections> <outlet property="scrollView" destination="8227" id="8231"/> </connections> @@ -3927,17 +3893,15 @@ DQ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="w4Z-p1-GZA"> <rect key="frame" x="1" y="1" width="381" height="204"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView editable="NO" importsGraphics="NO" verticallyResizable="YES" id="8219"> + <textView editable="NO" importsGraphics="NO" id="8219"> <rect key="frame" x="0.0" y="0.0" width="381" height="204"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <size key="minSize" width="381" height="204"/> <size key="maxSize" width="753" height="10000000"/> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="381" height="204"/> - <size key="maxSize" width="753" height="10000000"/> <connections> <outlet property="delegate" destination="134" id="8220"/> </connections> @@ -4035,17 +3999,15 @@ Gw <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="IdI-fg-CXh"> <rect key="frame" x="1" y="1" width="411" height="264"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" id="8213" customClass="SPTextView"> + <textView editable="NO" importsGraphics="NO" richText="NO" id="8213" customClass="SPTextView"> <rect key="frame" x="0.0" y="0.0" width="411" height="264"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <size key="minSize" width="411" height="264"/> <size key="maxSize" width="824" height="10000000"/> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="411" height="264"/> - <size key="maxSize" width="824" height="10000000"/> <connections> <outlet property="scrollView" destination="8210" id="8214"/> </connections> @@ -4111,17 +4073,15 @@ Gw <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="aEl-zD-ga2"> <rect key="frame" x="1" y="1" width="363" height="175"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" id="8202"> + <textView editable="NO" importsGraphics="NO" richText="NO" id="8202"> <rect key="frame" x="0.0" y="0.0" width="363" height="175"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <size key="minSize" width="363" height="175"/> <size key="maxSize" width="717" height="10000000"/> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="363" height="175"/> - <size key="maxSize" width="717" height="10000000"/> </textView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> @@ -4268,12 +4228,9 @@ Gw <action selector="helpSearchFindPreviousInPage:" target="134" id="5505"/> </connections> </button> - <box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="5509"> + <box verticalHuggingPriority="750" boxType="separator" id="5509"> <rect key="frame" x="0.0" y="269" width="505" height="5"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> - <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> - <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> - <font key="titleFont" metaFont="system"/> </box> <segmentedControl verticalHuggingPriority="750" id="5510"> <rect key="frame" x="347" y="279" width="152" height="20"/> @@ -4359,8 +4316,8 @@ Gw <rect key="frame" x="0.0" y="0.0" width="752" height="142"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="e9P-dP-cyb"> - <rect key="frame" x="0.0" y="23" width="752" height="119"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <rect key="frame" x="0.0" y="0.0" width="752" height="142"/> + <autoresizingMask key="autoresizingMask"/> <subviews> <tableView identifier="AdvancedFilterTableView" verticalHuggingPriority="750" allowsExpansionToolTips="YES" selectionHighlightStyle="sourceList" alternatingRowBackgroundColors="YES" emptySelection="NO" autosaveColumns="NO" headerView="8145" id="8144" customClass="SPCopyTable"> <rect key="frame" x="0.0" y="0.0" width="752" height="119"/> @@ -4389,7 +4346,6 @@ Gw </connections> </tableView> </subviews> - <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> </clipView> <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="8143"> <rect key="frame" x="1" y="95.851600000000005" width="751.5" height="15"/> @@ -4494,23 +4450,20 @@ Gw <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" copiesOnScroll="NO" id="FLj-pH-h40"> <rect key="frame" x="1" y="1" width="510" height="90"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView editable="NO" importsGraphics="NO" findStyle="panel" verticallyResizable="YES" allowsNonContiguousLayout="YES" id="8207" customClass="SPTextView"> + <textView editable="NO" importsGraphics="NO" findStyle="panel" allowsNonContiguousLayout="YES" id="8207" customClass="SPTextView"> <rect key="frame" x="0.0" y="0.0" width="510" height="90"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <size key="minSize" width="510" height="90"/> <size key="maxSize" width="518" height="10000000"/> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="510" height="90"/> - <size key="maxSize" width="518" height="10000000"/> <connections> <outlet property="delegate" destination="67" id="8208"/> </connections> </textView> </subviews> - <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> </clipView> <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="8206"> <rect key="frame" x="1" y="119" width="232" height="15"/> @@ -4865,8 +4818,8 @@ Gw <rect key="frame" x="0.0" y="0.0" width="360" height="157"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" drawsBackground="NO" id="en7-kg-fIt"> - <rect key="frame" x="1" y="23" width="358" height="133"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <rect key="frame" x="1" y="0.0" width="358" height="156"/> + <autoresizingMask key="autoresizingMask"/> <subviews> <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="sourceList" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="14" headerView="6890" id="6889"> <rect key="frame" x="0.0" y="0.0" width="358" height="133"/> @@ -5552,17 +5505,15 @@ Gw <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" id="Jv9-hI-7CJ"> <rect key="frame" x="1" y="1" width="392" height="110"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView editable="NO" importsGraphics="NO" richText="NO" allowsUndo="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" smartInsertDelete="YES" id="UVh-gz-xnJ"> + <textView editable="NO" importsGraphics="NO" richText="NO" allowsUndo="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" smartInsertDelete="YES" id="UVh-gz-xnJ"> <rect key="frame" x="0.0" y="0.0" width="392" height="110"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <size key="minSize" width="392" height="110"/> <size key="maxSize" width="463" height="10000000"/> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="392" height="110"/> - <size key="maxSize" width="463" height="10000000"/> </textView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> @@ -5593,9 +5544,9 @@ Gw <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="AYA-4f-zEy"> <rect key="frame" x="0.0" y="0.0" width="384" height="152"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <autoresizingMask key="autoresizingMask"/> <subviews> - <textView editable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" findStyle="panel" usesFontPanel="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" id="Bfr-0R-dqh"> + <textView editable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" usesFontPanel="YES" findStyle="panel" allowsNonContiguousLayout="YES" id="Bfr-0R-dqh"> <rect key="frame" x="0.0" y="0.0" width="384" height="152"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> @@ -5610,8 +5561,6 @@ Gw </fragment> </attributedString> <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <size key="minSize" width="384" height="152"/> - <size key="maxSize" width="463" height="10000000"/> </textView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> @@ -5640,8 +5589,8 @@ Gw <image name="NSRightFacingTriangleTemplate" width="9" height="12"/> <image name="button_action" width="30" height="22"/> <image name="button_add" width="30" height="22"/> - <image name="button_bar_handle" width="11" height="23"/> - <image name="button_bar_spacer" width="10" height="23"/> + <image name="button_bar_handle" width="15" height="23"/> + <image name="button_bar_spacer" width="11" height="23"/> <image name="button_duplicate" width="30" height="22"/> <image name="button_edit" width="30" height="22"/> <image name="button_edit_mode" width="30" height="22"/> diff --git a/Interfaces/English.lproj/MainWindow.xib b/Interfaces/English.lproj/MainWindow.xib index ed58bf1a..4b7ebe07 100644 --- a/Interfaces/English.lproj/MainWindow.xib +++ b/Interfaces/English.lproj/MainWindow.xib @@ -1,8 +1,9 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> <dependencies> <deployment identifier="macosx"/> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="SPWindowController"> @@ -24,8 +25,8 @@ <rect key="frame" x="0.0" y="0.0" width="948" height="555"/> <autoresizingMask key="autoresizingMask"/> <subviews> - <customView id="3" customClass="PSMTabBarControl"> - <rect key="frame" x="0.0" y="521" width="948" height="34"/> + <customView misplaced="YES" id="3" customClass="PSMTabBarControl"> + <rect key="frame" x="0.0" y="530" width="948" height="25"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <connections> <outlet property="delegate" destination="-2" id="12"/> @@ -33,8 +34,8 @@ <outlet property="tabView" destination="4" id="9"/> </connections> </customView> - <tabView drawsBackground="NO" type="noTabsNoBorder" id="4"> - <rect key="frame" x="0.0" y="0.0" width="948" height="521"/> + <tabView misplaced="YES" drawsBackground="NO" type="noTabsNoBorder" id="4"> + <rect key="frame" x="0.0" y="1" width="948" height="529"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <font key="font" metaFont="system"/> <tabViewItems/> diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 35620aac..1169e406 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -358,9 +358,6 @@ 58B9074A11BD9B34000826E5 /* overflowImage.png in Resources */ = {isa = PBXBuildFile; fileRef = 58B9070A11BD9B34000826E5 /* overflowImage.png */; }; 58B9074B11BD9B34000826E5 /* overflowImagePressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 58B9070B11BD9B34000826E5 /* overflowImagePressed.png */; }; 58B9074C11BD9B34000826E5 /* pi.png in Resources */ = {isa = PBXBuildFile; fileRef = 58B9070C11BD9B34000826E5 /* pi.png */; }; - 58B9075311BD9B34000826E5 /* TabNewMetal.png in Resources */ = {isa = PBXBuildFile; fileRef = 58B9071311BD9B34000826E5 /* TabNewMetal.png */; }; - 58B9075411BD9B34000826E5 /* TabNewMetalPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 58B9071411BD9B34000826E5 /* TabNewMetalPressed.png */; }; - 58B9075511BD9B34000826E5 /* TabNewMetalRollover.png in Resources */ = {isa = PBXBuildFile; fileRef = 58B9071511BD9B34000826E5 /* TabNewMetalRollover.png */; }; 58B9075611BD9B34000826E5 /* NSBezierPath_AMShading.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B9071611BD9B34000826E5 /* NSBezierPath_AMShading.h */; }; 58B9075711BD9B34000826E5 /* NSBezierPath_AMShading.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B9071711BD9B34000826E5 /* NSBezierPath_AMShading.m */; }; 58B9075811BD9B34000826E5 /* NSString_AITruncation.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B9071811BD9B34000826E5 /* NSString_AITruncation.h */; }; @@ -1186,16 +1183,6 @@ 58B9072C11BD9B34000826E5 /* PSMTabDragWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSMTabDragWindowController.h; sourceTree = "<group>"; }; 58B9072D11BD9B34000826E5 /* PSMTabDragWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSMTabDragWindowController.m; sourceTree = "<group>"; }; 58B9072E11BD9B34000826E5 /* PSMTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSMTabStyle.h; sourceTree = "<group>"; }; - 58B9073011BD9B34000826E5 /* PSMAdiumTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSMAdiumTabStyle.h; sourceTree = "<group>"; }; - 58B9073111BD9B34000826E5 /* PSMAdiumTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSMAdiumTabStyle.m; sourceTree = "<group>"; }; - 58B9073211BD9B34000826E5 /* PSMAquaTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSMAquaTabStyle.h; sourceTree = "<group>"; }; - 58B9073311BD9B34000826E5 /* PSMAquaTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSMAquaTabStyle.m; sourceTree = "<group>"; }; - 58B9073411BD9B34000826E5 /* PSMCardTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSMCardTabStyle.h; sourceTree = "<group>"; }; - 58B9073511BD9B34000826E5 /* PSMCardTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSMCardTabStyle.m; sourceTree = "<group>"; }; - 58B9073611BD9B34000826E5 /* PSMMetalTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSMMetalTabStyle.h; sourceTree = "<group>"; }; - 58B9073711BD9B34000826E5 /* PSMMetalTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSMMetalTabStyle.m; sourceTree = "<group>"; }; - 58B9073811BD9B34000826E5 /* PSMUnifiedTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSMUnifiedTabStyle.h; sourceTree = "<group>"; }; - 58B9073911BD9B34000826E5 /* PSMUnifiedTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSMUnifiedTabStyle.m; sourceTree = "<group>"; }; 58B9077D11BD9B64000826E5 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; 58B9088711BDB7AA000826E5 /* PSMTabBar-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "PSMTabBar-Info.plist"; path = "Plists/PSMTabBar-Info.plist"; sourceTree = "<group>"; }; 58B9095B11C3A3EC000826E5 /* xibLocalizationPostprocessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = xibLocalizationPostprocessor.m; sourceTree = "<group>"; }; @@ -2651,18 +2638,8 @@ 58B9072F11BD9B34000826E5 /* Styles */ = { isa = PBXGroup; children = ( - 58B9073011BD9B34000826E5 /* PSMAdiumTabStyle.h */, - 58B9073111BD9B34000826E5 /* PSMAdiumTabStyle.m */, - 58B9073211BD9B34000826E5 /* PSMAquaTabStyle.h */, - 58B9073311BD9B34000826E5 /* PSMAquaTabStyle.m */, - 58B9073411BD9B34000826E5 /* PSMCardTabStyle.h */, - 58B9073511BD9B34000826E5 /* PSMCardTabStyle.m */, - 58B9073611BD9B34000826E5 /* PSMMetalTabStyle.h */, - 58B9073711BD9B34000826E5 /* PSMMetalTabStyle.m */, B55F8E5D11C67CA0006A3386 /* PSMSequelProTabStyle.h */, B55F8E5E11C67CA0006A3386 /* PSMSequelProTabStyle.m */, - 58B9073811BD9B34000826E5 /* PSMUnifiedTabStyle.h */, - 58B9073911BD9B34000826E5 /* PSMUnifiedTabStyle.m */, ); path = Styles; sourceTree = "<group>"; @@ -3016,9 +2993,6 @@ 58B9074A11BD9B34000826E5 /* overflowImage.png in Resources */, 58B9074B11BD9B34000826E5 /* overflowImagePressed.png in Resources */, 58B9074C11BD9B34000826E5 /* pi.png in Resources */, - 58B9075311BD9B34000826E5 /* TabNewMetal.png in Resources */, - 58B9075411BD9B34000826E5 /* TabNewMetalPressed.png in Resources */, - 58B9075511BD9B34000826E5 /* TabNewMetalRollover.png in Resources */, B55F8E6611C67D8A006A3386 /* AddTabButton.png in Resources */, B55F8E6711C67D8A006A3386 /* AddTabButtonPushed.png in Resources */, B55F8E6811C67D8A006A3386 /* AddTabButtonRollover.png in Resources */, |