[vlc-commits] mac plugin: hide fullscreen button if fullscreen is not allowed
Felix Paul Kühne
git at videolan.org
Mon Feb 17 22:49:43 CET 2014
npapi-vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Feb 17 22:49:39 2014 +0100| [f9078437977eb776eb51ee9ae91de9ff2e938a15] | committer: Felix Paul Kühne
mac plugin: hide fullscreen button if fullscreen is not allowed
> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=f9078437977eb776eb51ee9ae91de9ff2e938a15
---
npapi/vlcplugin_mac.mm | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/npapi/vlcplugin_mac.mm b/npapi/vlcplugin_mac.mm
index f7f79dd..db6a8b1 100644
--- a/npapi/vlcplugin_mac.mm
+++ b/npapi/vlcplugin_mac.mm
@@ -641,9 +641,10 @@ bool VlcPluginMac::handle_event(void *event)
{
CGFloat sliderYPosition = (self.bounds.size.height - CGImageGetHeight(_sliderTrackLeft)) / 2.;
CGFloat playPauseButtonWidth = [self _playPauseButtonRect].size.width;
+ CGFloat fullscreenButtonWidth = self.cppPlugin->get_options().get_enable_fs() ? CGImageGetWidth(_enterFullscreen) : 0.;
return CGRectMake(playPauseButtonWidth + 7, sliderYPosition,
- self.bounds.size.width - playPauseButtonWidth - 15 - CGImageGetWidth(_enterFullscreen), CGImageGetHeight(_sliderTrackLeft));
+ self.bounds.size.width - playPauseButtonWidth - fullscreenButtonWidth - 15., CGImageGetHeight(_sliderTrackLeft));
}
- (CGRect)_sliderThumbRect
@@ -689,9 +690,11 @@ bool VlcPluginMac::handle_event(void *event)
CGContextDrawImage(context, sliderRightTrackRect, _sliderTrackRight);
// Draw fullscreen button
- CGRect fullscreenButtonRect = [self _fullscreenButtonRect];
- fullscreenButtonRect.origin.x = CGRectGetMaxX(sliderRightTrackRect) + 5;
- CGContextDrawImage(context, fullscreenButtonRect, self.isFullscreen ? _leaveFullscreen : _enterFullscreen);
+ if (self.cppPlugin->get_options().get_enable_fs()) {
+ CGRect fullscreenButtonRect = [self _fullscreenButtonRect];
+ fullscreenButtonRect.origin.x = CGRectGetMaxX(sliderRightTrackRect) + 5;
+ CGContextDrawImage(context, fullscreenButtonRect, self.isFullscreen ? _leaveFullscreen : _enterFullscreen);
+ }
}
- (void)drawInContext:(CGContextRef)cgContext
More information about the vlc-commits
mailing list