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

Commit

Permalink
Merge pull request #609 from BarakaAka1Only/master
Browse files Browse the repository at this point in the history
macOS Sierra Fixes w/ MiniPlayer and CSS Updates
  • Loading branch information
jacobwgillespie authored Sep 22, 2016
2 parents 4e40d12 + d48fef2 commit 111d7ee
Show file tree
Hide file tree
Showing 11 changed files with 300 additions and 58 deletions.
1 change: 1 addition & 0 deletions radiant-player-mac/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
- (void) ratingChanged:(NSInteger)rating;

- (id) preferenceForKey:(NSString *)key;
- (BOOL) isSierra;
- (BOOL) isElCapitan;
- (BOOL) isYosemite;
- (BOOL) isMavericks;
Expand Down
5 changes: 5 additions & 0 deletions radiant-player-mac/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,11 @@ - (id)preferenceForKey:(NSString *)key
return nil;
}

- (BOOL)isSierra
{
return floor(NSAppKitVersionNumber) >= 1485;
}

- (BOOL)isElCapitan
{
return floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_10_Max;
Expand Down
28 changes: 20 additions & 8 deletions radiant-player-mac/Popup/PopupView.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,28 @@ - (void)mouseExited:(NSEvent *)event

- (void)updateTrackingAreas
{

if (trackingArea != nil) {
[self removeTrackingArea:trackingArea];
if(!delegate.appDelegate.isSierra) {
[self removeTrackingArea:trackingArea];
}
}

if(!delegate.appDelegate.isSierra) {
int opts = (NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways);
trackingArea = [ [NSTrackingArea alloc] initWithRect:[self bounds]
options:opts
owner:self
userInfo:nil];
[self addTrackingArea:trackingArea];
} else {
NSTrackingArea* trackingArea = [[NSTrackingArea alloc]
initWithRect:[self bounds]
options: (NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways)
owner:self
userInfo:nil];
[self addTrackingArea:trackingArea];
}

int opts = (NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways);
trackingArea = [ [NSTrackingArea alloc] initWithRect:[self bounds]
options:opts
owner:self
userInfo:nil];
[self addTrackingArea:trackingArea];
}

- (void)setHoverAlphaMultiplier:(CGFloat)hoverAlphaMultiplier
Expand Down
2 changes: 1 addition & 1 deletion radiant-player-mac/Styles/DarkCyanStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ - (id)init

- (void)applyToWebView:(WebView *)webView window:(NSWindow *)window
{
[self setCss:[NSString stringWithFormat:@"%@%@", [self css], [ApplicationStyle cssNamed:@"spotify-black"]]];
[self setCss:[NSString stringWithFormat:@"%@%@", [ApplicationStyle cssNamed:@"spotify-black"] , [self css]]];
[super applyToWebView:webView window:window];
}

Expand Down
2 changes: 2 additions & 0 deletions radiant-player-mac/WebView/CookieStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
- (void)unarchive;
- (void)clearCookies;

- (BOOL) isSierra;

+ (NSString *)defaultCookieStoragePath;

@end
5 changes: 5 additions & 0 deletions radiant-player-mac/WebView/CookieStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ + (NSString *)defaultCookieStoragePath

#pragma mark - Miscellaneous

- (BOOL)isSierra
{
return floor(NSAppKitVersionNumber) >= 1485;
}

+ (BOOL)hostMatchesDomainWithURL:(NSURL *)url domain:(NSString *)domain
{
// The domain must either match the host exactly, or it must
Expand Down
5 changes: 4 additions & 1 deletion radiant-player-mac/WebView/CustomWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ - (void)handleCookiesForRequest:(NSMutableURLRequest *)request redirectResponse:
[[CookieStorage instance] handleCookiesInResponse:(NSHTTPURLResponse *)redirectResponse];
}

[request setHTTPShouldHandleCookies:NO];
if(![[CookieStorage instance] isSierra]){
[request setHTTPShouldHandleCookies:NO];
}

[[CookieStorage instance] handleCookiesInRequest:request];
}

Expand Down
28 changes: 28 additions & 0 deletions radiant-player-mac/css/dark-cyan.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,31 @@ paper-action-dialog.get-link .content paper-spinner .circle,
paper-header-panel#content-container.transparent #material-app-bar {
background-color: rgba(3, 166, 181, 0.4)!important;
}

/* New drawer / other additions */
[class*="sj-play-button"] #pulse {
background-color: rgba(3, 156, 172, 0.4)!important;
}

[class*="sj-play-button"] #buttonContent {
background: #039cac!important;
}

.primary:not([style-scope]):not(.style-scope) {
color: #039cac!important;
}

paper-dialog input::selection,
paper-dialog textarea::selection {
background-color: rgba(3, 156, 172, 0.25) !important
}

.label-is-highlighted [id*="paper-input-label"],
[class*="paper-input-container"] .add-on-content.is-highlighted.paper-input-container * {
color: #039cac!important;
}

.ups,
.focused-line {
background: #039cac!important;
}
10 changes: 6 additions & 4 deletions radiant-player-mac/css/google.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@

/* Fill to highlight thumbed up/down track in status bar */
paper-icon-button[aria-label="Undo thumb-up"] iron-icon {
background: url('https://radiant-player-mac/images/sprites.png') no-repeat -276px -235px;
background-size: 763px 360px;
/*background: url('https://radiant-player-mac/images/sprites.png') no-repeat -265px -222px;
background-size: 725px 335px;*/
display: inline-block;
}

paper-icon-button[aria-label="Undo thumb-down"] iron-icon {
background: url('https://radiant-player-mac/images/sprites.png') no-repeat -165px -323px;
background-size: 763px 360px;
/*background: url('https://radiant-player-mac/images/sprites.png') no-repeat -165px -333px;
background-size: 753px 368px;*/
display: inline-block;
}
83 changes: 67 additions & 16 deletions radiant-player-mac/css/rdiant.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ textarea, .top-charts-view .song-row [data-col="index"] .column-content,
.material-card .details .left-items .index, .button,
.simple-dialog-buttons button, .download-submit, .goog-menuheader, .now-playing-menu .goog-menuitem .goog-menuitem-content,
.goog-menuitem-content, #loading-progress-message, .screensaver .collage .text.time, .visualizercard .label, .bar-button .text {
font-family: 'Whitney', 'Open Sans', Helvetica, arial, sans-serif;
font-family: 'Whitney', 'Open Sans', Helvetica, arial, sans-serif;
}
.cluster .header .title, .cluster .header .subtitle,
.material-detail-view .material-container-details .info .title,
Expand Down Expand Up @@ -47,16 +47,16 @@ paper-button, .material .recommended-header,
#time_container_current, #time_container_duration,
#mini-queue-details .playing-from-title, #mini-queue-details .playing-from .album, #mini-queue-details .playing-from
{
font-weight: 300;
font-weight: 300;
}
body.material {
background-color:#FFF;
background-color:#FFF;
}
#material-app-bar {
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.07);
-webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.07);
-moz-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.07);
-o-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.07);
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.07);
-webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.07);
-moz-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.07);
-o-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.07);
}

iron-icon[icon="av:explicit"],
Expand Down Expand Up @@ -87,7 +87,7 @@ paper-action-dialog sj-paper-button, paper-dialog .buttons paper-button,
paper-slider#sliderBar paper-ripple.paper-slider,
.material .song-table .song-row.currently-playing td
{
color: #018fd5!important;
color: #018fd5!important;
}

.music-source-list::-webkit-scrollbar-thumb,
Expand All @@ -105,7 +105,7 @@ paper-slider#material-player-progress #sliderContainer.disabled #sliderBar #acti
.material-drag .song-drag-label,
.material-transfer-radial-upload-overlay, .material-transfer-radial-download-overlay, .material-transfer-radial-processing-overlay,
#current-loading-progress {
background-color: #018fd5!important;
background-color: #018fd5!important;
}

paper-checkbox #checkbox.checked,
Expand All @@ -116,26 +116,77 @@ paper-action-dialog.get-link .content paper-spinner .circle,
.nav-section .selected,
#sliderKnobInner.paper-slider
{
border-color: #018fd5!important;
border-color: #018fd5!important;
}

.material-container-details sj-fab, .material-container-details paper-fab {
background: #018fd5!important;
background: #018fd5!important;
}

paper-header-panel#content-container.transparent #material-app-bar,
paper-toggle-button[checked]:not([disabled]) .toggle-button.paper-toggle-button,
paper-toggle-button[checked]:not([disabled]) .toggle-bar.paper-toggle-button {
background-color: rgba(1, 143, 213, 0.4)!important;
background-color: rgba(1, 143, 213, 0.4)!important;
}

/* Fill to highlight thumbed up/down track in status bar */
paper-icon-button[aria-label="Undo thumb-up"] iron-icon {
background: url('https://radiant-player-mac/images/sprites.png') no-repeat -276px -235px;
background-size: 763px 360px;
/*background: url('https://radiant-player-mac/images/sprites.png') no-repeat -265px -222px;
background-size: 725px 335px;*/
display: inline-block;
}

paper-icon-button[aria-label="Undo thumb-down"] iron-icon {
background: url('https://radiant-player-mac/images/sprites.png') no-repeat -165px -323px;
background-size: 763px 360px;
/*background: url('https://radiant-player-mac/images/sprites.png') no-repeat -165px -333px;
background-size: 753px 368px;*/
display: inline-block;
}


/* New drawer / other additions */
[class*="sj-play-button"] #pulse {
background-color: rgba(1, 143, 213, 0.4)!important;
}

[class*="sj-play-button"] #buttonContent {
background: #018fd5!important;
}
.primary:not([style-scope]):not(.style-scope) {
color: #018fd5!important;
}

paper-dialog input::selection,
paper-dialog textarea::selection {
background-color: rgba(1, 143, 213, 0.25) !important
}

.label-is-highlighted [id*="paper-input-label"],
[class*="paper-input-container"] .add-on-content.is-highlighted.paper-input-container * {
color: #018fd5!important;
}

.ups,
.focused-line {
background: #018fd5!important;
}

.ups.light {
background: transparent!important;
}

.ups paper-button,
.ad-preroll-message-link paper-button,
paper-button.nav-item-container.sub {
background-color: #0170a7!important;
}

.ups paper-button:focus,
.ad-preroll-message-link paper-button:focus,
paper-button.nav-item-container.sub:focus {
background-color: #018fd5!important;
border: 1px solid #0170a7!important
}

.share-buttons .share-button iron-icon {
z-index: 0 !important;
}
Loading

0 comments on commit 111d7ee

Please sign in to comment.