diff --git a/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_1x.png b/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_1x.png index a1d870a..e2768a1 100644 Binary files a/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_1x.png and b/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_1x.png differ diff --git a/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_2x.png b/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_2x.png index c043cd1..609be5e 100644 Binary files a/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_2x.png and b/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_2x.png differ diff --git a/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_3x.png b/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_3x.png index f3e9a6e..42046ec 100644 Binary files a/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_3x.png and b/Limelight/Images.xcassets/NoAppImage.imageset/limelight_no_app_image_3x.png differ diff --git a/Limelight/UIAppView.m b/Limelight/UIAppView.m index de9cfa9..40df8d6 100644 --- a/Limelight/UIAppView.m +++ b/Limelight/UIAppView.m @@ -27,21 +27,6 @@ static int LABEL_DY = 20; [_appButton sizeToFit]; [_appButton addTarget:self action:@selector(appClicked) forControlEvents:UIControlEventTouchUpInside]; - // Remove Shadow and label - /* - _appButton.layer.shadowColor = [[UIColor blackColor] CGColor]; - _appButton.layer.shadowOffset = CGSizeMake(5,8); - _appButton.layer.shadowOpacity = 0.7; - - _appLabel = [[UILabel alloc] init]; - [_appLabel setText:_app.appName]; - [_appLabel sizeToFit]; - _appLabel.center = CGPointMake(_appButton.bounds.origin.x + (_appButton.bounds.size.width / 2), _appButton.bounds.origin.y + _appButton.bounds.size.height + LABEL_DY); - - [self updateBounds]; - [self addSubview:_appLabel]; - */ - [self addSubview:_appButton]; [self sizeToFit]; @@ -66,6 +51,22 @@ static int LABEL_DY = 20; [_appButton setBackgroundImage:_app.appImage forState:UIControlStateNormal]; [self setNeedsDisplay]; } + + // TODO: Improve no-app image detection + if (_app.appImage == nil || (_app.appImage.size.width == 130.f && _app.appImage.size.height == 180.f)) { // This size of image might be blank image received from GameStream. + _appLabel = [[UILabel alloc] init]; + CGFloat padding = 4.f; + [_appLabel setFrame: CGRectMake(padding, padding, _appButton.frame.size.width - 2 * padding, _appButton.frame.size.height - 2 * padding)]; + [_appLabel setTextColor:[UIColor whiteColor]]; + [_appLabel setFont:[UIFont systemFontOfSize:10.f]]; + [_appLabel setBaselineAdjustment:UIBaselineAdjustmentAlignCenters]; + [_appLabel setTextAlignment:NSTextAlignmentCenter]; + [_appLabel setLineBreakMode:NSLineBreakByWordWrapping]; + [_appLabel setNumberOfLines:0]; + [_appLabel setText:_app.appName]; + [_appButton addSubview:_appLabel]; + } + } /*