[vlc-commits] macosx: improve resize behaviour of splitview

David Fuhrmann git at videolan.org
Tue Jun 26 22:55:50 CEST 2012


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Tue Jun 26 22:50:05 2012 +0200| [0f4b97b08a1805c6c72f94dbfcbebb61bf956bb8] | committer: David Fuhrmann

macosx: improve resize behaviour of splitview

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0f4b97b08a1805c6c72f94dbfcbebb61bf956bb8
---

 modules/gui/macosx/MainWindow.m |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index af8355f..8411784 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -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 */



More information about the vlc-commits mailing list