Commit 44c6d658 authored by Benjamin Pracht's avatar Benjamin Pracht

* intf.* : try to restore an a bit more intelligent behavior for the playlist...

* intf.* : try to restore an a bit more intelligent behavior for the playlist toggle button (remeber previous state, for instance)
* misc.* : get rid of unused code.

parent 2d55c0f1
......@@ -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;
......
......@@ -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 )
......
......@@ -25,13 +25,11 @@
* VLCControllerWindow
*****************************************************************************/
@interface VLCControllerWindow : NSWindow
{
NSSize o_size_with_playlist;
}
- (NSSize)getSizeWithPlaylist;
@end
/*****************************************************************************
......
......@@ -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 );
......@@ -51,24 +49,6 @@
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment