]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/misc.m
* Implements playlist toggle button
[vlc] / modules / gui / macosx / misc.m
index 7bcfbc4125ecfb9b9163a0f47a908fcffd92c0fe..946495b0e009cfed866a84b57c6d77ec91f146f9 100644 (file)
     self = [super initWithContentRect:contentRect styleMask:styleMask //& ~NSTitledWindowMask
     backing:backingType defer:flag];
 
+    o_size_with_playlist = [self frame].size;
+
+    [[[VLCMain sharedInstance] getPlaylist] updateTogglePlaylistState];
+
     return( self );
 }
 
     return [[VLCMain sharedInstance] hasDefinedShortcutKey:o_event];
 }
 
+/*Stores the size the controller one resize, to be able to restore it when
+  toggling the playlist*/
+
+- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)proposedFrameSize
+{
+    o_size_with_playlist = proposedFrameSize;
+
+    /*Callback to update the state of Playlist Toggle Button*/
+    [[[VLCMain sharedInstance] getPlaylist] updateTogglePlaylistState];
+
+    return proposedFrameSize;
+}
+
+- (NSSize)getSizeWithPlaylist
+{
+    return o_size_with_playlist;
+}
+
 @end