From fe720fa4c0ef67c94136af51d9c6f51c26d58186 Mon Sep 17 00:00:00 2001 From: michael starke Date: Tue, 3 Mar 2015 14:46:42 +0100 Subject: [PATCH] Gradients for Trash now use correct style on 10.10 --- MacPass/MPContextBarViewController.m | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/MacPass/MPContextBarViewController.m b/MacPass/MPContextBarViewController.m index de367fbe..a66b0144 100644 --- a/MacPass/MPContextBarViewController.m +++ b/MacPass/MPContextBarViewController.m @@ -59,17 +59,21 @@ typedef NS_ENUM(NSUInteger, MPContextTab) { - (void)awakeFromNib { [[self.filterLabelTextField cell] setBackgroundStyle:NSBackgroundStyleRaised]; + /* Setup History Bar colors */ self.historyBar.activeGradient = [[NSGradient alloc] initWithStartingColor:[[NSColor orangeColor] shadowWithLevel:0.2] endingColor:[[NSColor orangeColor] highlightWithLevel:0.2]]; - NSArray *activeColors = @[[NSColor colorWithCalibratedWhite:0.2 alpha:1],[NSColor colorWithCalibratedWhite:0.4 alpha:1]]; - NSArray *inactiveColors = @[[NSColor colorWithCalibratedWhite:0.3 alpha:1],[NSColor colorWithCalibratedWhite:0.6 alpha:1]]; - self.trashBar.activeGradient = [[NSGradient alloc] initWithColors:activeColors]; - self.trashBar.inactiveGradient = [[NSGradient alloc] initWithColors:inactiveColors]; + /* Setup Trash Bar color */ + if(!HNHIsRunningOnYosemiteOrNewer()) { + NSArray *activeColors = @[[NSColor colorWithCalibratedWhite:0.2 alpha:1],[NSColor colorWithCalibratedWhite:0.4 alpha:1]]; + NSArray *inactiveColors = @[[NSColor colorWithCalibratedWhite:0.3 alpha:1],[NSColor colorWithCalibratedWhite:0.6 alpha:1]]; + self.trashBar.activeGradient = [[NSGradient alloc] initWithColors:activeColors]; + self.trashBar.inactiveGradient = [[NSGradient alloc] initWithColors:inactiveColors]; + //self.emptyTrashButton.textColor = [NSColor whiteColor]; + } + [[self view] bind:NSSelectedIndexBinding toObject:self withKeyPath:@"activeTab" options:nil]; - - self.emptyTrashButton.textColor = [NSColor whiteColor]; - + /* Setup Filter Bar buttons and menu */ NSInteger tags[] = { MPEntrySearchTitles, MPEntrySearchUsernames, MPEntrySearchPasswords, MPEntrySearchNotes, MPEntrySearchUrls }; NSArray *buttons = @[self.titleButton, self.usernameButton, self.passwordButton, self.notesButton, self.urlButton ]; for(NSUInteger iIndex = 0; iIndex < [buttons count]; iIndex++) {