]> git.sesse.net Git - vlc/commitdiff
* intf.* : try to restore an a bit more intelligent behavior for the playlist toggle...
authorBenjamin Pracht <bigben@videolan.org>
Tue, 12 Apr 2005 14:31:14 +0000 (14:31 +0000)
committerBenjamin Pracht <bigben@videolan.org>
Tue, 12 Apr 2005 14:31:14 +0000 (14:31 +0000)
* misc.* : get rid of unused code.

modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/misc.h
modules/gui/macosx/misc.m

index 31e2169fe62abf7d31cf7e556e96d349050a195e..c63b52a1bfe8ce28ef5b2a9dcf9248a0ea782ec4 100644 (file)
@@ -234,10 +234,13 @@ struct intf_sys_t
     IBOutlet id o_dmi_next;
     IBOutlet id o_dmi_previous;
     IBOutlet id o_dmi_mute;
-    
+
     bool b_small_window;
-    
+
     mtime_t i_end_scroll;
+
+    NSSize o_size_with_playlist;
+
 }
 
 + (VLCMain *)sharedInstance;
index 10ca87ab09330f00151ca19bfaff09f245a596a1..e2ac383708bcd91c88d826080eabf93a37f5e5cb 100644 (file)
@@ -397,6 +397,8 @@ static VLCMain *_o_sharedMainInstance = nil;
     }
     [self updateTogglePlaylistState];
 
+    o_size_with_playlist = [o_window frame].size;
+
     p_playlist = (playlist_t *) vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
 
     if( p_playlist )
@@ -1516,8 +1518,21 @@ static VLCMain *_o_sharedMainInstance = nil;
     {
         b_small_window = YES; /* we know we are small, make sure this is actually set (see case below) */
         /* make large */
-        o_rect.size.height = 500;
-        
+        if ( o_size_with_playlist.height > 200 )
+        {
+            o_rect.size.height = o_size_with_playlist.height;
+        }
+        else
+        {
+            o_rect.size.height = 500;
+            if ( o_rect.size.width == [o_window minSize].width )
+            {
+                o_rect.size.width = 500;
+            }
+
+        }
+        o_rect.size.height = (o_size_with_playlist.height > 200) ?
+            o_size_with_playlist.height : 500;
         o_rect.origin.x = [o_window frame].origin.x;
         o_rect.origin.y = [o_window frame].origin.y - o_rect.size.height +
                                                 [o_window minSize].height;
@@ -1531,7 +1546,7 @@ static VLCMain *_o_sharedMainInstance = nil;
         /* Calculate the position of the lower right corner after resize */
         o_rect.origin.y = [o_window frame].origin.y +
             [o_window frame].size.height - [o_window minSize].height;
-        
+
         [o_playlist_view setAutoresizesSubviews: NO];
         [o_playlist_view removeFromSuperview];
         [o_btn_playlist setState: NO];
@@ -1556,6 +1571,11 @@ static VLCMain *_o_sharedMainInstance = nil;
 - (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)proposedFrameSize
 {
     /* Not triggered on a window resize or maxification of the window. only by window mouse dragging resize */
+
+   /*Stores the size the controller one resize, to be able to restore it when
+     toggling the playlist*/
+    o_size_with_playlist = proposedFrameSize;
+
     if( proposedFrameSize.height <= 200 )
     {
         if( b_small_window == NO )
index fa8a70509dd9ecbf6c00441667a2ead1237a4cae..f656ed2de75e7d9b816030a5cd8bdce709fd29d1 100644 (file)
  * VLCControllerWindow
  *****************************************************************************/
 
+
 @interface VLCControllerWindow : NSWindow
 {
-    NSSize o_size_with_playlist;
 }
 
-- (NSSize)getSizeWithPlaylist;
-
 @end
 
 /*****************************************************************************
index f4c2f7181cff3b54499492f58c1980118e5a03bb..a85213af28bcc98f65a1edecd75d5fa851325fa9 100644 (file)
@@ -39,8 +39,6 @@
     self = [super initWithContentRect:contentRect styleMask:styleMask //& ~NSTitledWindowMask
     backing:backingType defer:flag];
 
-    o_size_with_playlist = [self frame].size;
-
     [[VLCMain sharedInstance] 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] updateTogglePlaylistState];
-
-    return proposedFrameSize;
-}
-
-- (NSSize)getSizeWithPlaylist
-{
-    return o_size_with_playlist;
-}
-
 @end