From fcb68bc54fa76f2bd76612ce9fe0108fadcfbc47 Mon Sep 17 00:00:00 2001 From: TrueZhuanjia Date: Fri, 6 Jun 2025 22:44:17 +0800 Subject: [PATCH] settingView close/expand control --- .../ViewControllers/MainFrameViewController.h | 3 ++- .../ViewControllers/MainFrameViewController.m | 17 +++++++++++------ .../ViewControllers/SettingsViewController.m | 8 +------- .../ViewControllers/StreamFrameViewController.m | 3 ++- Moonlight.xcodeproj/project.pbxproj | 2 ++ 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Limelight/ViewControllers/MainFrameViewController.h b/Limelight/ViewControllers/MainFrameViewController.h index 5ef880e5..ad850215 100644 --- a/Limelight/ViewControllers/MainFrameViewController.h +++ b/Limelight/ViewControllers/MainFrameViewController.h @@ -30,7 +30,8 @@ @property (weak, nonatomic) IBOutlet UINavigationItem *navigationItem; --(void)simulateSettingsButtonPress; +-(void)expandSettingsView; +- (void)closeSettingViewAnimated:(BOOL)anaimated; -(void)reloadStreamConfig; -(bool)isIPhonePortrait; #endif diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index 431ba635..11cc414d 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -382,13 +382,12 @@ static NSMutableSet* hostList; if (host.state == StateOnline && host.pairState == PairStatePaired && host.appList.count > 0) { [self switchToAppView]; } - } - (void)launchButtonTappedForHost:(TemporaryHost *)host { _selectedHost = host; if (host.state == StateOnline && host.pairState == PairStatePaired && host.appList.count > 0) { - [[self revealViewController] revealToggleAnimated:NO]; + [self closeSettingViewAnimated:NO]; [self switchToAppView]; [self updateAppsForHost:_selectedHost]; [self prepareToStreamApp:_sortedAppList.firstObject]; @@ -1065,13 +1064,19 @@ static NSMutableSet* hostList; #if !TARGET_OS_TV -- (void)simulateSettingsButtonPress { //simulate pressing the setting button, called from setting view controller. - //if([self isIPhonePortrait]) return; // disable settings view expanding in iphone portrait mode since it's buggy. - if (_settingsButton.target && [_settingsButton.target respondsToSelector:_settingsButton.action]) { - [_settingsButton.target performSelector:_settingsButton.action withObject:_settingsButton]; +- (void)expandSettingsView { //simulate pressing the setting button, called from setting view controller. + if (currentPosition == FrontViewPositionLeft) { + [[self revealViewController] revealToggleAnimated:YES]; } } +- (void)closeSettingViewAnimated:(BOOL)anaimated { //simulate pressing the setting button, called from setting view controller. + if (currentPosition != FrontViewPositionLeft) { + [[self revealViewController] revealToggleAnimated:anaimated]; + } +} + + - (void)handleOrientationChange { // UIDeviceOrientation targetOrientation = [[UIDevice currentDevice] orientation]; // if([self isIPhone] && UIDeviceOrientationIsPortrait(targetOrientation)) [self simulateSettingsButtonPressClose]; // on iphone, force close settings views if target orietation is portrait. diff --git a/Limelight/ViewControllers/SettingsViewController.m b/Limelight/ViewControllers/SettingsViewController.m index 12fd42d2..ce21b196 100644 --- a/Limelight/ViewControllers/SettingsViewController.m +++ b/Limelight/ViewControllers/SettingsViewController.m @@ -328,12 +328,6 @@ BOOL isCustomResolution(CGSize res) { }); } - -- (void)simulateSettingsButtonPress{ - [self.mainFrameViewController simulateSettingsButtonPress]; -} - - - (void)viewDidDisappear:(BOOL)animated{ [super viewDidDisappear:NO]; [[NSNotificationCenter defaultCenter] postNotificationName:@"SettingsViewClosedNotification" object:self]; // notify other view that settings view just closed @@ -358,7 +352,7 @@ BOOL isCustomResolution(CGSize res) { } - (void)edgeSwiped { - [self simulateSettingsButtonPress]; + [self.mainFrameViewController closeSettingViewAnimated:YES]; } - (BOOL)isIPhone { diff --git a/Limelight/ViewControllers/StreamFrameViewController.m b/Limelight/ViewControllers/StreamFrameViewController.m index d8ed1473..416594d3 100644 --- a/Limelight/ViewControllers/StreamFrameViewController.m +++ b/Limelight/ViewControllers/StreamFrameViewController.m @@ -729,10 +729,11 @@ - (void)expandSettingsView{ self.mainFrameViewcontroller.settingsExpandedInStreamView = true; //notify mainFrameViewContorller that this is a setting expansion in stream view, some settings shall be disabled. - [self.mainFrameViewcontroller simulateSettingsButtonPress]; + [self.mainFrameViewcontroller expandSettingsView]; } - (void)edgeSwiped{ + return; // disable this now. if([self->_mainFrameViewcontroller isIPhonePortrait]){ // disable backmenu for iphone portrait mode; [self returnToMainFrame]; //directly quit the session return; diff --git a/Moonlight.xcodeproj/project.pbxproj b/Moonlight.xcodeproj/project.pbxproj index 71576ca9..53df7a7b 100644 --- a/Moonlight.xcodeproj/project.pbxproj +++ b/Moonlight.xcodeproj/project.pbxproj @@ -1112,6 +1112,7 @@ INFOPLIST_FILE = "Limelight/Limelight-Info.plist"; INFOPLIST_KEY_CFBundleDisplayName = MoonlightZWM; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1170,6 +1171,7 @@ INFOPLIST_FILE = "Limelight/Limelight-Info.plist"; INFOPLIST_KEY_CFBundleDisplayName = MoonlightZWM; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks",