Browse Source

MovieViewController: fix buttonpositions in landscape (close #10295)

Carola Nitz 11 years ago
parent
commit
fb96693ed7
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Sources/VLCMovieViewController.m

+ 6 - 2
Sources/VLCMovieViewController.m

@@ -343,11 +343,15 @@
     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
         CGSize viewSize = self.view.frame.size;
         CGSize viewSize = self.view.frame.size;
         if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)) {
         if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)) {
+            CGFloat rightSpace = _videoeffectsContainer.frame.origin.x - CGRectGetMaxX(_fwdButton.frame);
+            CGFloat gapSize = (rightSpace - _repeatButton.frame.size.width - _audioSwitcherContainer.frame.size.width) / 3.0;
             [_controllerPanel setFrame:CGRectMake(0, viewSize.height - 55, viewSize.width, 55)];
             [_controllerPanel setFrame:CGRectMake(0, viewSize.height - 55, viewSize.width, 55)];
-            [_repeatButton setFrame:CGRectMake(8, 16, 32, 35)];
-            [_audioSwitcherContainer setFrame:CGRectMake(48, 12, 40, 40)];
+            [_volumeView setFrame:CGRectMake(gapSize, 22, _bwdButton.frame.origin.x - 2 * gapSize, 22)];
+            [_audioSwitcherContainer setFrame:CGRectMake(CGRectGetMaxX(_fwdButton.frame) + gapSize, 14, 40, 40)];
+            [_repeatButton setFrame:CGRectMake(CGRectGetMaxX(_audioSwitcherContainer.frame) + gapSize, 16, 32, 35)];
         } else {
         } else {
             [_controllerPanel setFrame:CGRectMake(0, viewSize.height - 90, viewSize.width, 90)];
             [_controllerPanel setFrame:CGRectMake(0, viewSize.height - 90, viewSize.width, 90)];
+            [_volumeView setFrame:CGRectMake(60, 61, 244, 22)];
             [_repeatButton setFrame:CGRectMake(18, 54, 32, 35)];
             [_repeatButton setFrame:CGRectMake(18, 54, 32, 35)];
             [_audioSwitcherContainer setFrame:CGRectMake(20, 14, 40, 40)];
             [_audioSwitcherContainer setFrame:CGRectMake(20, 14, 40, 40)];
         }
         }