From 96a222823ac3fed134eba79e6ccfaf847a204445 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 5 Jan 2011 00:16:33 +0000 Subject: - Tweak tab bar background colour when the window is in the background to decrease contrast --- Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Frameworks/PSMTabBar') diff --git a/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m index 9ec84db8..c748a4df 100644 --- a/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m @@ -409,7 +409,7 @@ // When the window is in the background, tone down the colours if (![[tabBar window] isMainWindow] || ![NSApp isActive]) { - backgroundCalibratedWhite = 0.685; + backgroundCalibratedWhite = 0.73; lineCalibratedWhite = 0.49; shadowAlpha = 0.3; } @@ -514,7 +514,7 @@ fillColor = [NSColor colorWithCalibratedWhite:0.81 alpha:1.0]; shadowColor = [NSColor colorWithCalibratedWhite:0.0 alpha:0.4]; } else { - fillColor = [NSColor colorWithCalibratedWhite:0.685 alpha:1.0]; + fillColor = [NSColor colorWithCalibratedWhite:0.73 alpha:1.0]; shadowColor = [NSColor colorWithCalibratedWhite:0.0 alpha:0.7]; } } @@ -533,7 +533,7 @@ topLeftArcCenter = NSMakePoint(aRect.origin.x - kPSMSequelProTabCornerRadius + 0.5, aRect.origin.y + kPSMSequelProTabCornerRadius); topRightArcCenter = NSMakePoint(aRect.origin.x + aRect.size.width + kPSMSequelProTabCornerRadius + 0.5, aRect.origin.y + kPSMSequelProTabCornerRadius); bottomLeftArcCenter = NSMakePoint(aRect.origin.x + kPSMSequelProTabCornerRadius + 0.5, aRect.origin.y + aRect.size.height - kPSMSequelProTabCornerRadius); - bottomRightArcCenter = NSMakePoint(aRect.origin.x + aRect.size.width - kPSMSequelProTabCornerRadius + 0.5, aRect.origin.y + aRect.size.height - kPSMSequelProTabCornerRadius ); + bottomRightArcCenter = NSMakePoint(aRect.origin.x + aRect.size.width - kPSMSequelProTabCornerRadius + 0.5, aRect.origin.y + aRect.size.height - kPSMSequelProTabCornerRadius); // Construct the outline path if (drawLeftEdge) { -- cgit v1.2.3 From 735706ae233348a072a6fcaee806e7c5def9477e Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sun, 16 Jan 2011 20:36:27 +0000 Subject: - Change window change notifications from key change notifications to main change notifications - fixes issues with tab bars showing incorrect colours when displaying sheets --- Frameworks/PSMTabBar/PSMTabBarControl.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Frameworks/PSMTabBar') diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m index a9268a78..8debd774 100644 --- a/Frameworks/PSMTabBar/PSMTabBarControl.m +++ b/Frameworks/PSMTabBar/PSMTabBarControl.m @@ -265,8 +265,8 @@ } if (aWindow) { - [center addObserver:self selector:@selector(windowStatusDidChange:) name:NSWindowDidBecomeKeyNotification object:aWindow]; - [center addObserver:self selector:@selector(windowStatusDidChange:) name:NSWindowDidResignKeyNotification object:aWindow]; + [center addObserver:self selector:@selector(windowStatusDidChange:) name:NSWindowDidBecomeMainNotification object:aWindow]; + [center addObserver:self selector:@selector(windowStatusDidChange:) name:NSWindowDidResignMainNotification object:aWindow]; [center addObserver:self selector:@selector(windowDidUpdate:) name:NSWindowDidUpdateNotification object:aWindow]; [center addObserver:self selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:aWindow]; } -- cgit v1.2.3 From 326ad6df4b8c99b3dd103ad2a27de6dc09309191 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 20 Jan 2011 09:51:23 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20several=20memory=20leaks=20in=20PSM?= =?UTF-8?q?TabBar=20for=20NSMutableParagraphStyle=20(thanks=20to=20report?= =?UTF-8?q?=20i957)=20and=20NSShadows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m | 5 +++-- Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m | 7 ++++--- Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m | 4 ++-- Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m | 5 +++-- Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m | 10 +++++++--- Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m | 7 ++++--- 6 files changed, 23 insertions(+), 15 deletions(-) (limited to 'Frameworks/PSMTabBar') diff --git a/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m index be5cf82d..3bda9cf5 100644 --- a/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m @@ -399,7 +399,7 @@ // Paragraph Style for Truncating Long Text static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:TruncatingTailParagraphStyle range:range]; @@ -995,11 +995,12 @@ NSMutableParagraphStyle *centeredParagraphStyle = nil; if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; + [centeredParagraphStyle release]; [attrStr drawInRect:labelRect]; return; } diff --git a/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m index f2618fe5..901f3b4a 100644 --- a/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m @@ -312,12 +312,12 @@ // Paragraph Style for Truncating Long Text static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; [TruncatingTailParagraphStyle setAlignment:NSCenterTextAlignment]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:TruncatingTailParagraphStyle range:range]; - + return attrStr; } @@ -414,10 +414,11 @@ [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; NSMutableParagraphStyle *centeredParagraphStyle = nil; if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; + [centeredParagraphStyle release]; [attrStr drawInRect:labelRect]; return; } diff --git a/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m index 31da000c..56c3a173 100644 --- a/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m @@ -298,11 +298,11 @@ // Paragraph Style for Truncating Long Text static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:TruncatingTailParagraphStyle range:range]; - + return attrStr; } diff --git a/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m index 443179ce..db9bbd86 100644 --- a/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m @@ -327,7 +327,7 @@ // Paragraph Style for Truncating Long Text static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; [TruncatingTailParagraphStyle setAlignment:NSCenterTextAlignment]; } @@ -592,10 +592,11 @@ [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; NSMutableParagraphStyle *centeredParagraphStyle = nil; if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; + [centeredParagraphStyle release]; [attrStr drawInRect:labelRect]; return; } diff --git a/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m index c748a4df..48db93c3 100644 --- a/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m @@ -337,7 +337,7 @@ // Paragraph Style for Truncating Long Text static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; [TruncatingTailParagraphStyle setAlignment:NSCenterTextAlignment]; } @@ -375,10 +375,11 @@ NSMutableParagraphStyle *centeredParagraphStyle = nil; if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; + [centeredParagraphStyle release]; [attrStr drawInRect:labelRect]; return; } @@ -594,6 +595,7 @@ [shadow setShadowOffset:NSMakeSize(0, 1)]; [shadow set]; [outlineBezier stroke]; + [shadow release]; // Add the shadow over the tops of background tabs } else if (drawLeftEdge || drawRightEdge) { @@ -632,12 +634,14 @@ // Draw, and then restore the previous graphics state [outlineBezier stroke]; + [shadow release]; CGContextRestoreGState(context); } [NSGraphicsContext restoreGraphicsState]; - [self drawInteriorWithTabCell:cell inView:[cell controlView]]; + [self drawInteriorWithTabCell:cell inView:[cell controlView]]; + } diff --git a/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m index 13fb0994..76b5efc1 100644 --- a/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m @@ -297,11 +297,11 @@ // Paragraph Style for Truncating Long Text static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; if (!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:TruncatingTailParagraphStyle range:range]; - + return attrStr; } @@ -540,10 +540,11 @@ [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; NSMutableParagraphStyle *centeredParagraphStyle = nil; if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; + [centeredParagraphStyle release]; [attrStr drawInRect:labelRect]; return; } -- cgit v1.2.3