From: Faustino Osuna Date: Fri, 4 Jan 2008 16:26:52 +0000 (+0000) Subject: MacOSX/VLC_app: Make application responsible for window to fullscreen transition. X-Git-Tag: 0.9.0-test0~3663 X-Git-Url: https://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;p=vlc.git;a=commitdiff_plain;h=555be2977b4a02db9a5a9f344eca9747e3a7141c;ds=sidebyside MacOSX/VLC_app: Make application responsible for window to fullscreen transition. --- diff --git a/extras/MacOSX/VLC_app/Sources/VLCBrowsableVideoView.h b/extras/MacOSX/VLC_app/Sources/VLCBrowsableVideoView.h index d8f3d5dd7f..25758bb227 100644 --- a/extras/MacOSX/VLC_app/Sources/VLCBrowsableVideoView.h +++ b/extras/MacOSX/VLC_app/Sources/VLCBrowsableVideoView.h @@ -38,7 +38,8 @@ NSString * nodeKeyPath; NSString * contentKeyPath; id selectedObject; - + BOOL fullScreen; + /* Actions on non-node items*/ id target; SEL action; @@ -51,6 +52,8 @@ @property (readonly, retain) id selectedObject; +@property (readwrite) BOOL fullScreen; + /* Set up a specific action to do, on items that don't have node. * action first argument is the browsableVideoView. You can get the selected object, * with -selectedObject */ diff --git a/extras/MacOSX/VLC_app/Sources/VLCBrowsableVideoView.m b/extras/MacOSX/VLC_app/Sources/VLCBrowsableVideoView.m index aaf2a8d4d4..e9e28a3b40 100644 --- a/extras/MacOSX/VLC_app/Sources/VLCBrowsableVideoView.m +++ b/extras/MacOSX/VLC_app/Sources/VLCBrowsableVideoView.m @@ -62,6 +62,7 @@ - (NSArray *)itemsTree { return itemsTree; } + - (void)setItemsTree:(NSArray *)newItemsTree { [itemsTree release]; @@ -69,6 +70,26 @@ [self changeSelectedPath:[[[NSIndexPath alloc] init] autorelease] withSelectedIndex:0]; } +- (BOOL)fullScreen +{ + return [super isInFullScreenMode]; +} + +- (void)setFullScreen:(BOOL)newFullScreen +{ + if( newFullScreen == self.fullScreen ) + return; + + if( newFullScreen ) + { + [super enterFullScreenMode:[[self window] screen] withOptions:nil]; + } + else + { + [super exitFullScreenModeWithOptions:nil]; + } +} + /* Initializer */ - (void)awakeFromNib { @@ -85,7 +106,6 @@ //[self changeSelectedIndex:0]; } - /* Hiding/Displaying the menu */ - (void)hideMenu @@ -157,6 +177,14 @@ [self changeSelectedIndex:selectedIndex+1]; } +- (void)mouseDown:(NSEvent *)theEvent +{ + if([theEvent clickCount] != 2) + return; + + self.fullScreen = !self.fullScreen; +} + - (void)keyDown:(NSEvent *)theEvent { if(([[theEvent charactersIgnoringModifiers] characterAtIndex:0] == 13) && menuDisplayed)