fixed: settings menu accidentally resized on iPad
This commit is contained in:
1 parent
ac0aa29578
commit
acd4a04076
1 file changed
+8
-2
@@ -1650,6 +1650,8 @@ static NSMutableSet* hostList;
|
|||||||
// [settingsViewController updateResolutionTable];
|
// [settingsViewController updateResolutionTable];
|
||||||
|
|
||||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleMenuResize:)];
|
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleMenuResize:)];
|
||||||
|
longPress.delaysTouchesBegan = false;
|
||||||
|
longPress.delaysTouchesEnded = false;
|
||||||
[self.view addGestureRecognizer:longPress];
|
[self.view addGestureRecognizer:longPress];
|
||||||
|
|
||||||
|
|
||||||
@@ -1657,6 +1659,8 @@ static NSMutableSet* hostList;
|
|||||||
SettingsViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"settingsViewController"];
|
SettingsViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"settingsViewController"];
|
||||||
// 强制加载视图
|
// 强制加载视图
|
||||||
__unused UIView *view = viewController.view;
|
__unused UIView *view = viewController.view;
|
||||||
|
|
||||||
|
snapshot = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)viewDidLayoutSubviews{
|
-(void)viewDidLayoutSubviews{
|
||||||
@@ -2221,15 +2225,17 @@ static NSMutableSet* hostList;
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isPortrait = screenHeight>screenWidth;
|
bool isPortrait = screenHeight>screenWidth;
|
||||||
|
|
||||||
CGFloat limitedWidth = MIN(MAX(locationInSuperView.x, isPortrait ? 200 : 280),isPortrait ? screenWidth*0.75 : screenWidth/2);
|
CGFloat limitedWidth = MIN(MAX(locationInSuperView.x, isPortrait ? 200 : 280),isPortrait ? screenWidth*0.75 : screenWidth/2);
|
||||||
if(gesture.state == UIGestureRecognizerStateChanged){
|
if(gesture.state == UIGestureRecognizerStateChanged){
|
||||||
if(snapshot) snapshot.center = CGPointMake(limitedWidth, snapshot.center.y);
|
if(snapshot) snapshot.center = CGPointMake(limitedWidth, snapshot.center.y);
|
||||||
}
|
}
|
||||||
if(gesture.state == UIGestureRecognizerStateEnded || gesture.state == UIGestureRecognizerStateCancelled){
|
if(gesture.state == UIGestureRecognizerStateEnded){
|
||||||
|
if(!snapshot) return;
|
||||||
[snapshot removeFromSuperview];
|
[snapshot removeFromSuperview];
|
||||||
|
snapshot = nil;
|
||||||
self.revealViewController.rearViewRevealWidth = limitedWidth;
|
self.revealViewController.rearViewRevealWidth = limitedWidth;
|
||||||
[self.revealViewController setupNavigationBar];
|
[self.revealViewController setupNavigationBar];
|
||||||
if(self.revealViewController.isStreaming) [self.revealViewController buttonsInStreaming];
|
if(self.revealViewController.isStreaming) [self.revealViewController buttonsInStreaming];
|
||||||
|
|||||||
Reference in new issue
Block a user