mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 22:50:57 +00:00
Allow tvOS to back out from app grid to PC grid
This commit is contained in:
@@ -48,7 +48,9 @@
|
|||||||
NSArray* _sortedAppList;
|
NSArray* _sortedAppList;
|
||||||
NSCache* _boxArtCache;
|
NSCache* _boxArtCache;
|
||||||
bool _background;
|
bool _background;
|
||||||
#if !TARGET_OS_TV
|
#if TARGET_OS_TV
|
||||||
|
UITapGestureRecognizer* _menuRecognizer;
|
||||||
|
#else
|
||||||
UIButton* _pullArrow;
|
UIButton* _pullArrow;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -231,6 +233,12 @@ static NSMutableSet* hostList;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)showHostSelectionView {
|
- (void)showHostSelectionView {
|
||||||
|
#if TARGET_OS_TV
|
||||||
|
// Remove the menu button intercept to allow the app to exit
|
||||||
|
// when at the host selection view.
|
||||||
|
[self.view removeGestureRecognizer:_menuRecognizer];
|
||||||
|
#endif
|
||||||
|
|
||||||
[_appManager stopRetrieving];
|
[_appManager stopRetrieving];
|
||||||
_selectedHost = nil;
|
_selectedHost = nil;
|
||||||
_computerNameButton.title = @"No Host Selected";
|
_computerNameButton.title = @"No Host Selected";
|
||||||
@@ -276,6 +284,11 @@ static NSMutableSet* hostList;
|
|||||||
_selectedHost = host;
|
_selectedHost = host;
|
||||||
[self disableNavigation];
|
[self disableNavigation];
|
||||||
|
|
||||||
|
#if TARGET_OS_TV
|
||||||
|
// Intercept the menu key to go back to the host page
|
||||||
|
[self.view addGestureRecognizer:_menuRecognizer];
|
||||||
|
#endif
|
||||||
|
|
||||||
// If we are online, paired, and have a cached app list, skip straight
|
// If we are online, paired, and have a cached app list, skip straight
|
||||||
// to the app grid without a loading frame. This is the fast path that users
|
// to the app grid without a loading frame. This is the fast path that users
|
||||||
// should hit most. Check for a valid view because we don't want to hit the fast
|
// should hit most. Check for a valid view because we don't want to hit the fast
|
||||||
@@ -663,6 +676,10 @@ static NSMutableSet* hostList;
|
|||||||
|
|
||||||
// Get callbacks associated with the viewController
|
// Get callbacks associated with the viewController
|
||||||
[self.revealViewController setDelegate:self];
|
[self.revealViewController setDelegate:self];
|
||||||
|
#else
|
||||||
|
_menuRecognizer = [[UITapGestureRecognizer alloc] init];
|
||||||
|
[_menuRecognizer addTarget:self action: @selector(showHostSelectionView)];
|
||||||
|
_menuRecognizer.allowedPressTypes = [[NSArray alloc] initWithObjects:[NSNumber numberWithLong:UIPressTypeMenu], nil];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_loadingFrame = [self.storyboard instantiateViewControllerWithIdentifier:@"loadingFrame"];
|
_loadingFrame = [self.storyboard instantiateViewControllerWithIdentifier:@"loadingFrame"];
|
||||||
|
|||||||
Reference in New Issue
Block a user