]> git.sesse.net Git - vlc/commitdiff
MacOSX/VLC_app: Make application responsible for window to fullscreen transition.
authorFaustino Osuna <riquedafreak@videolan.org>
Fri, 4 Jan 2008 16:26:52 +0000 (16:26 +0000)
committerFaustino Osuna <riquedafreak@videolan.org>
Fri, 4 Jan 2008 16:26:52 +0000 (16:26 +0000)
extras/MacOSX/VLC_app/Sources/VLCBrowsableVideoView.h
extras/MacOSX/VLC_app/Sources/VLCBrowsableVideoView.m

index d8f3d5dd7fdf1a0bd3ea4a83d65529ae577480c7..25758bb2278bf5280ce08fc985d2870fd8cf2dd7 100644 (file)
@@ -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 */
index aaf2a8d4d462c0b7662be940c97f3e655a989e2c..e9e28a3b4017e297785073cb6fb4c409d8e25aff 100644 (file)
@@ -62,6 +62,7 @@
 - (NSArray *)itemsTree {
     return itemsTree;
 }
+
 - (void)setItemsTree:(NSArray *)newItemsTree
 {
     [itemsTree release];
     [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
 {
     //[self changeSelectedIndex:0];
 }
 
-
 /* Hiding/Displaying the menu */
 
 - (void)hideMenu
     [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)