Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
Handle style deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
kbhomes committed May 20, 2015
1 parent 80570cf commit 9ad1157
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions radiant-player-mac/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ - (NSMutableDictionary *)styles
if (_styles == nil)
{
_styles = [ApplicationStyle styles];
[_styles setObject:[[GoogleStyle alloc] init] forKey:@"Empty"];
[_styles setObject:[[GoogleStyle alloc] init] forKey:@"Google"];
}

return _styles;
Expand Down Expand Up @@ -941,8 +941,13 @@ - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
NSString *styleName = [defaults stringForKey:@"styles.name"];
ApplicationStyle *style = [_styles objectForKey:styleName];

if (!style) {
[defaults setObject:@"Google" forKey:@"styles.name"];
[defaults synchronize];
}

if (!stylesEnabled || !style)
style = [_styles objectForKey:@"Empty"];
style = [_styles objectForKey:@"Google"];

[style applyToWebView:webView window:window];

Expand Down
4 changes: 2 additions & 2 deletions radiant-player-mac/Styles/SpotifyBlackStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ @implementation SpotifyBlackStyle
- (id)init
{
if (self = [super init]) {
[self setName:@"Spotify Black"];
[self setName:@"Black"];
[self setAuthor:@"Anthony Barone"];
[self setDescription:@"A black style similar to the new Spotify."];
[self setDescription:@"A deep black style."];
[self setWindowColor:[NSColor colorWithSRGBRed:0.133f green:0.137f blue:0.149f alpha:1.0f]];
[self setTitleColor:[NSColor colorWithDeviceWhite:0.7f alpha:1.0f]];
[self setCss:[ApplicationStyle cssNamed:@"spotify-black"]];
Expand Down

0 comments on commit 9ad1157

Please sign in to comment.