Commit e908f36f authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: make sure that the main window's split view is correctly resized on relaunch (close #6597)

parent 1dcc6e6f
......@@ -21,16 +21,16 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="4850"/>
<integer value="29"/>
<integer value="4948"/>
<integer value="915"/>
<integer value="2770"/>
<integer value="2730"/>
<integer value="4722"/>
<integer value="4596"/>
<integer value="2"/>
<integer value="29"/>
<integer value="2730"/>
<integer value="915"/>
<integer value="4948"/>
<integer value="1617"/>
<integer value="4713"/>
<integer value="4850"/>
<integer value="2770"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -604,7 +604,6 @@
<int key="NSViewLayerContentsRedrawPolicy">2</int>
<bool key="NSIsVertical">YES</bool>
<int key="NSDividerStyle">2</int>
<string key="NSAutosaveName">10thanniversary-splitview</string>
</object>
<object class="NSCustomView" id="515305233">
<reference key="NSNextResponder" ref="429932428"/>
......@@ -12064,9 +12063,9 @@ LCAuLi4</string>
<string>{{430, 565}, {137, 103}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{364, 446}, {604, 310}}</string>
<string>{{363, 446}, {604, 310}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{364, 446}, {604, 310}}</string>
<string>{{363, 446}, {604, 310}}</string>
<boolean value="YES"/>
<boolean value="NO"/>
<boolean value="NO"/>
......
......@@ -546,6 +546,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(applicationWillTerminate:) name: NSApplicationWillTerminateNotification object: nil];
[[VLCMain sharedInstance] playbackModeUpdated];
[o_split_view setAutosaveName:@"10thanniversary-splitview"];
if (b_splitviewShouldBeHidden)
{
i_lastSplitViewHeight = [o_split_view frame].size.height;
......@@ -1091,7 +1092,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
return proposedFrameSize;
}
#pragma mark -
#pragma mark Update interface and respond to foreign events
- (void)showDropZone
......@@ -2070,11 +2070,16 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex
{
if (dividerIndex == 0)
return ([self frame].size.width - 400.0);
return 300.;
else
return proposedMax;
}
- (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview
{
return ([subview isEqual:o_left_split_view]);
}
#pragma mark -
#pragma mark Side Bar Data handling
/* taken under BSD-new from the PXSourceList sample project, adapted for VLC */
......
......@@ -686,23 +686,6 @@ void _drawFrameInRect(NSRect frameRect)
{
return 1.0;
}
- (void)adjustSubviews
{
NSArray *o_subviews = [self subviews];
NSRect viewDimensions = [self frame];
NSRect leftViewDimensions = [[o_subviews objectAtIndex:0] frame];
NSRect rightViewDimensions = [[o_subviews objectAtIndex:1] frame];
CGFloat f_dividerThickness = [self dividerThickness];
leftViewDimensions.size.height = viewDimensions.size.height;
[[o_subviews objectAtIndex:0] setFrame: leftViewDimensions];
rightViewDimensions.origin.x = leftViewDimensions.size.width + f_dividerThickness;
rightViewDimensions.size.width = viewDimensions.size.width - leftViewDimensions.size.width - f_dividerThickness;
rightViewDimensions.size.height = viewDimensions.size.height;
[[o_subviews objectAtIndex:1] setFrame: rightViewDimensions];
}
@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