From f5e0443abb39bbf42866b2bf7559d6d11d095e22 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 14 Nov 2020 16:45:43 -0600 Subject: [PATCH] Hide shadows on hidden app tiles --- Limelight/UIAppView.m | 5 +++++ Limelight/ViewControllers/MainFrameViewController.m | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Limelight/UIAppView.m b/Limelight/UIAppView.m index 4b78702..0429f21 100644 --- a/Limelight/UIAppView.m +++ b/Limelight/UIAppView.m @@ -220,6 +220,11 @@ static UIImage* noImage; [self updateAppImage]; } + // Show no shadow for hidden apps. Because we adjust the opacity of the + // cells for hidden apps, it makes them look bad when the shadow draws + // through the app tile. + self.superview.layer.shadowOpacity = _app.hidden ? 0.0f : 0.5f; + // Update opacity if neccessary [self setAlpha:_app.hidden ? 0.4 : 1.0]; diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index 8c72600..487b055 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -1297,13 +1297,13 @@ static NSMutableSet* hostList; [cell.subviews.firstObject removeFromSuperview]; // Remove a view that was previously added [cell addSubview:appView]; - + // Shadow opacity is controlled inside UIAppView based on whether the app + // is hidden or not during the update cycle. UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:cell.bounds]; cell.layer.masksToBounds = NO; cell.layer.shadowColor = [UIColor blackColor].CGColor; cell.layer.shadowOffset = CGSizeMake(1.0f, 5.0f); - cell.layer.shadowOpacity = 0.5f; cell.layer.shadowPath = shadowPath.CGPath; #if !TARGET_OS_TV