Browse Source

Hide aspect ratio and video effects buttons during audio-only playback (close #11296)

Felix Paul Kühne 11 years ago
parent
commit
e5d51fcc10
2 changed files with 22 additions and 0 deletions
  1. 1 0
      NEWS
  2. 21 0
      Sources/VLCMovieViewController.m

+ 1 - 0
NEWS

@@ -5,6 +5,7 @@
   requested through third-party app (#11147)
 * Option to set text encoding used for FTP connections (#10611)
 * Media library search (#11303)
+* Minor UI improvements (#11296)
 
 2.3:
 ----

+ 21 - 0
Sources/VLCMovieViewController.m

@@ -1488,7 +1488,28 @@
 
         if (self.trackNameLabel.text.length < 1)
             self.trackNameLabel.text = [[_mediaPlayer.media url] lastPathComponent];
+
+        if (!self.aspectRatioButton.hidden) {
+            CGRect rect = self.timeDisplay.frame;
+            rect.origin.x += self.aspectRatioButton.frame.size.width;
+            self.timeDisplay.frame = rect;
+            rect = self.positionSlider.frame;
+            rect.size.width += self.aspectRatioButton.frame.size.width;
+            self.positionSlider.frame = rect;
+            self.aspectRatioButton.hidden = YES;
+        }
+    } else {
+        if (self.aspectRatioButton.hidden) {
+            CGRect rect = self.timeDisplay.frame;
+            rect.origin.x -= self.aspectRatioButton.frame.size.width;
+            self.timeDisplay.frame = rect;
+            rect = self.positionSlider.frame;
+            rect.size.width -= self.aspectRatioButton.frame.size.width;
+            self.positionSlider.frame = rect;
+            self.aspectRatioButton.hidden = NO;
+        }
     }
+    self.videoFilterButton.hidden = mediaIsAudioOnly;
 
     /* don't leak sensitive information to the OS, if passcode lock is enabled */
     BOOL passcodeLockEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingPasscodeOnKey] boolValue];