macosx: improve resize behaviour of splitview
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Tue, 26 Jun 2012 20:50:05 +0000 (22:50 +0200)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Tue, 26 Jun 2012 20:55:47 +0000 (22:55 +0200)
Now, the sidebar will not  will not resized while resizing the window.
Also, this commit sets a min width for the the sidebar. But it can
still be hidden, just drag the slider to the left.

modules/gui/macosx/MainWindow.m

index af8355f..8411784 100644 (file)
@@ -2458,11 +2458,26 @@ static VLCMainWindow *_o_sharedInstance = nil;
         return proposedMax;
 }
 
+- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
+{
+    if (dividerIndex == 0)
+        return 100.;
+    else
+        return proposedMin;
+}
+
 - (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview
 {
     return ([subview isEqual:o_left_split_view]);
 }
 
+- (BOOL)splitView:(NSSplitView *)splitView shouldAdjustSizeOfSubview:(NSView *)subview
+{
+    if ([subview isEqual:o_left_split_view])
+        return NO;
+    return YES;
+}
+
 #pragma mark -
 #pragma mark Side Bar Data handling
 /* taken under BSD-new from the PXSourceList sample project, adapted for VLC */