Commit 10f7cb74 authored by David Fuhrmann's avatar David Fuhrmann

macosx: Fix drawing issues with podcast controls and dropzone

- Remove black lines below podcast controls
- fix uncentered dropzone when starting native fullscreen, by slightly
  increasing the min height
- fix disappearing or uncentered dropzone when changing between
  normal and minimum view quickly
- consolidate dropzone and podcast sizings in interface builder

(cherry picked from commit 58b713c7f84e8eb9eedc8ca383ac59cd212db234)
Signed-off-by: default avatarDavid Fuhrmann <dfuhrmann@videolan.org>
parent 4dab7846
...@@ -21,9 +21,11 @@ ...@@ -21,9 +21,11 @@
</object> </object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<integer value="5260"/> <integer value="5305"/>
<integer value="5605"/> <integer value="5605"/>
<integer value="5608"/> <integer value="4756"/>
<integer value="5265"/>
<integer value="5260"/>
<integer value="4850"/> <integer value="4850"/>
</object> </object>
<object class="NSArray" key="IBDocument.PluginDependencies"> <object class="NSArray" key="IBDocument.PluginDependencies">
...@@ -1328,7 +1330,7 @@ ...@@ -1328,7 +1330,7 @@
<reference key="NSSuperview" ref="83235998"/> <reference key="NSSuperview" ref="83235998"/>
</object> </object>
</object> </object>
<string key="NSFrame">{{50, 35}, {300, 230}}</string> <string key="NSFrame">{{10, 10}, {300, 230}}</string>
<reference key="NSSuperview" ref="108902636"/> <reference key="NSSuperview" ref="108902636"/>
<string key="NSOffsets">{0, 0}</string> <string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell"> <object class="NSTextFieldCell" key="NSTitleCell">
...@@ -1350,7 +1352,7 @@ ...@@ -1350,7 +1352,7 @@
<bool key="NSFullyTransparent">YES</bool> <bool key="NSFullyTransparent">YES</bool>
</object> </object>
</object> </object>
<string key="NSFrameSize">{400, 300}</string> <string key="NSFrameSize">{320, 250}</string>
<reference key="NSSuperview" ref="256817023"/> <reference key="NSSuperview" ref="256817023"/>
<string key="NSReuseIdentifierKey">_NS:1109</string> <string key="NSReuseIdentifierKey">_NS:1109</string>
<string key="NSClassName">VLCDragDropView</string> <string key="NSClassName">VLCDragDropView</string>
...@@ -1370,7 +1372,7 @@ ...@@ -1370,7 +1372,7 @@
<string>NeXT TIFF v4.0 pasteboard type</string> <string>NeXT TIFF v4.0 pasteboard type</string>
</object> </object>
</object> </object>
<string key="NSFrameSize">{400, 300}</string> <string key="NSFrameSize">{320, 250}</string>
<reference key="NSSuperview" ref="256817023"/> <reference key="NSSuperview" ref="256817023"/>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="1064809555"> <object class="NSImageCell" key="NSCell" id="1064809555">
...@@ -1389,7 +1391,7 @@ ...@@ -1389,7 +1391,7 @@
<bool key="NSEditable">YES</bool> <bool key="NSEditable">YES</bool>
</object> </object>
</object> </object>
<string key="NSFrameSize">{400, 300}</string> <string key="NSFrameSize">{320, 250}</string>
<reference key="NSSuperview"/> <reference key="NSSuperview"/>
<object class="CIDarkenBlendMode" key="NSViewCompositeFilter"> <object class="CIDarkenBlendMode" key="NSViewCompositeFilter">
<bool key="CIEnabled">YES</bool> <bool key="CIEnabled">YES</bool>
...@@ -1404,7 +1406,7 @@ ...@@ -1404,7 +1406,7 @@
<object class="NSButton" id="545072553"> <object class="NSButton" id="545072553">
<reference key="NSNextResponder" ref="115834448"/> <reference key="NSNextResponder" ref="115834448"/>
<int key="NSvFlags">265</int> <int key="NSvFlags">265</int>
<string key="NSFrame">{{298, 1}, {101, 17}}</string> <string key="NSFrame">{{298, -1}, {101, 17}}</string>
<reference key="NSSuperview" ref="115834448"/> <reference key="NSSuperview" ref="115834448"/>
<string key="NSReuseIdentifierKey">_NS:125</string> <string key="NSReuseIdentifierKey">_NS:125</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
...@@ -1430,7 +1432,7 @@ ...@@ -1430,7 +1432,7 @@
<object class="NSButton" id="882473348"> <object class="NSButton" id="882473348">
<reference key="NSNextResponder" ref="115834448"/> <reference key="NSNextResponder" ref="115834448"/>
<int key="NSvFlags">268</int> <int key="NSvFlags">268</int>
<string key="NSFrame">{{5, 1}, {101, 17}}</string> <string key="NSFrame">{{5, -1}, {101, 17}}</string>
<reference key="NSSuperview" ref="115834448"/> <reference key="NSSuperview" ref="115834448"/>
<string key="NSReuseIdentifierKey">_NS:125</string> <string key="NSReuseIdentifierKey">_NS:125</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
...@@ -1455,7 +1457,7 @@ ...@@ -1455,7 +1457,7 @@
</object> </object>
<object class="NSImageView" id="157740914"> <object class="NSImageView" id="157740914">
<reference key="NSNextResponder" ref="115834448"/> <reference key="NSNextResponder" ref="115834448"/>
<int key="NSvFlags">266</int> <int key="NSvFlags">314</int>
<object class="NSMutableSet" key="NSDragTypes"> <object class="NSMutableSet" key="NSDragTypes">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="set.sortedObjects"> <object class="NSArray" key="set.sortedObjects">
...@@ -1468,7 +1470,7 @@ ...@@ -1468,7 +1470,7 @@
<string>NeXT TIFF v4.0 pasteboard type</string> <string>NeXT TIFF v4.0 pasteboard type</string>
</object> </object>
</object> </object>
<string key="NSFrame">{{0, -2}, {403, 23}}</string> <string key="NSFrame">{{0, -6}, {403, 25}}</string>
<reference key="NSSuperview" ref="115834448"/> <reference key="NSSuperview" ref="115834448"/>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="816225529"> <object class="NSImageCell" key="NSCell" id="816225529">
...@@ -1484,7 +1486,7 @@ ...@@ -1484,7 +1486,7 @@
<bool key="NSEditable">YES</bool> <bool key="NSEditable">YES</bool>
</object> </object>
</object> </object>
<string key="NSFrameSize">{403, 21}</string> <string key="NSFrameSize">{403, 19}</string>
<reference key="NSSuperview"/> <reference key="NSSuperview"/>
<string key="NSReuseIdentifierKey">_NS:1109</string> <string key="NSReuseIdentifierKey">_NS:1109</string>
<string key="NSClassName">NSView</string> <string key="NSClassName">NSView</string>
...@@ -1503,7 +1505,7 @@ ...@@ -1503,7 +1505,7 @@
<string key="NSWindowContentMaxSize">{612, 159}</string> <string key="NSWindowContentMaxSize">{612, 159}</string>
<string key="NSWindowContentMinSize">{612, 159}</string> <string key="NSWindowContentMinSize">{612, 159}</string>
<object class="NSView" key="NSWindowView" id="383192078"> <object class="NSView" key="NSWindowView" id="383192078">
<nil key="NSNextResponder"/> <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int> <int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews"> <object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
...@@ -1619,6 +1621,7 @@ ...@@ -1619,6 +1621,7 @@
</object> </object>
</object> </object>
<string key="NSFrameSize">{612, 159}</string> <string key="NSFrameSize">{612, 159}</string>
<reference key="NSSuperview"/>
</object> </object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> <string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMinSize">{612, 181}</string> <string key="NSMinSize">{612, 181}</string>
...@@ -1639,7 +1642,7 @@ ...@@ -1639,7 +1642,7 @@
<string key="NSWindowContentMaxSize">{612, 159}</string> <string key="NSWindowContentMaxSize">{612, 159}</string>
<string key="NSWindowContentMinSize">{612, 159}</string> <string key="NSWindowContentMinSize">{612, 159}</string>
<object class="NSView" key="NSWindowView" id="306630988"> <object class="NSView" key="NSWindowView" id="306630988">
<nil key="NSNextResponder"/> <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int> <int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews"> <object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
...@@ -1800,6 +1803,7 @@ ...@@ -1800,6 +1803,7 @@
</object> </object>
</object> </object>
<string key="NSFrameSize">{612, 159}</string> <string key="NSFrameSize">{612, 159}</string>
<reference key="NSSuperview"/>
</object> </object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> <string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMinSize">{612, 181}</string> <string key="NSMinSize">{612, 181}</string>
...@@ -3931,7 +3935,7 @@ ...@@ -3931,7 +3935,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{566, 376}, {400, 300}}</string> <string>{{566, 426}, {320, 250}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform"/> <object class="NSAffineTransform"/>
<string>VLCDropDisabledImageView</string> <string>VLCDropDisabledImageView</string>
...@@ -4006,7 +4010,7 @@ ...@@ -4006,7 +4010,7 @@
<object class="NSAffineTransform"> <object class="NSAffineTransform">
<bytes key="NSTransformStruct">AUNbAABBIAAAA</bytes> <bytes key="NSTransformStruct">AUNbAABBIAAAA</bytes>
</object> </object>
<string>{{565, 246}, {403, 21}}</string> <string>{{565, 248}, {403, 19}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform"> <object class="NSAffineTransform">
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
- (void)hidePodcastControls; - (void)hidePodcastControls;
@end @end
static const float f_min_window_height = 307.;
@implementation VLCMainWindow @implementation VLCMainWindow
...@@ -201,9 +202,9 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -201,9 +202,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
[self setAcceptsMouseMovedEvents: YES]; [self setAcceptsMouseMovedEvents: YES];
// Set that here as IB seems to be buggy // Set that here as IB seems to be buggy
if (b_dark_interface) if (b_dark_interface)
[self setContentMinSize:NSMakeSize(604., 288. + [o_titlebar_view frame].size.height)]; [self setContentMinSize:NSMakeSize(604., f_min_window_height + [o_titlebar_view frame].size.height)];
else else
[self setContentMinSize:NSMakeSize(604., 288.)]; [self setContentMinSize:NSMakeSize(604., f_min_window_height)];
[self setTitle: _NS("VLC media player")]; [self setTitle: _NS("VLC media player")];
...@@ -441,28 +442,30 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -441,28 +442,30 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)resizePlaylistAfterCollapse - (void)resizePlaylistAfterCollapse
{ {
// no animation here since we might be in the middle of another resize animation // no animation here since we might be in the middle of another resize animation
NSRect rightSplitRect = [o_right_split_view frame];
NSRect plrect; NSRect plrect;
plrect = [o_playlist_table frame]; plrect.size.height = rightSplitRect.size.height - 20.0; // actual pl top bar height, which differs from its frame
plrect.size.height = [o_split_view frame].size.height - 20.0; // actual pl top bar height, which differs from its frame plrect.size.width = rightSplitRect.size.width;
[o_playlist_table setFrame: plrect]; plrect.origin.x = plrect.origin.y = 0.;
[o_playlist_table setNeedsDisplay: YES];
NSRect rightSplitRect; NSRect dropzoneboxRect = [o_dropzone_box frame];
rightSplitRect = [o_right_split_view frame]; dropzoneboxRect.origin.x = (plrect.size.width - dropzoneboxRect.size.width) / 2;
plrect = [o_dropzone_box frame]; dropzoneboxRect.origin.y = (plrect.size.height - dropzoneboxRect.size.height) / 2;
plrect.origin.x = (rightSplitRect.size.width - plrect.size.width) / 2;
plrect.origin.y = (rightSplitRect.size.height - plrect.size.height) / 2; [o_playlist_table setFrame: plrect];
[o_dropzone_view setFrame: [o_playlist_table frame]]; [o_dropzone_view setFrame: plrect];
[o_dropzone_box setFrame: plrect]; [o_dropzone_box setFrame: dropzoneboxRect];
[o_dropzone_view setNeedsDisplay: YES]; [o_dropzone_view setNeedsDisplay: YES];
[o_playlist_table setNeedsDisplay: YES];
} }
- (void)makeSplitViewVisible - (void)makeSplitViewVisible
{ {
if (b_dark_interface) if (b_dark_interface)
[self setContentMinSize: NSMakeSize(604., 288. + [o_titlebar_view frame].size.height)]; [self setContentMinSize: NSMakeSize(604., f_min_window_height + [o_titlebar_view frame].size.height)];
else else
[self setContentMinSize: NSMakeSize(604., 288.)]; [self setContentMinSize: NSMakeSize(604., f_min_window_height)];
NSRect old_frame = [self frame]; NSRect old_frame = [self frame];
CGFloat newHeight = [self minSize].height; CGFloat newHeight = [self minSize].height;
...@@ -630,6 +633,9 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -630,6 +633,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)hideSplitView:(BOOL)b_with_resize - (void)hideSplitView:(BOOL)b_with_resize
{ {
// cancel pending pl resizes, in case of fast toggle between both modes
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(resizePlaylistAfterCollapse) object:nil];
if (b_with_resize) { if (b_with_resize) {
NSRect winrect = [self frame]; NSRect winrect = [self frame];
f_lastSplitViewHeight = [o_split_view frame].size.height; f_lastSplitViewHeight = [o_split_view frame].size.height;
...@@ -638,7 +644,6 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -638,7 +644,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
[self setFrame: winrect display: YES animate: YES]; [self setFrame: winrect display: YES animate: YES];
} }
[self performSelector:@selector(hideDropZone) withObject:nil afterDelay:0.1];
if (b_dark_interface) { if (b_dark_interface) {
[self setContentMinSize: NSMakeSize(604., [o_controls_bar height] + [o_titlebar_view frame].size.height)]; [self setContentMinSize: NSMakeSize(604., [o_controls_bar height] + [o_titlebar_view frame].size.height)];
[self setContentMaxSize: NSMakeSize(FLT_MAX, [o_controls_bar height] + [o_titlebar_view frame].size.height)]; [self setContentMaxSize: NSMakeSize(FLT_MAX, [o_controls_bar height] + [o_titlebar_view frame].size.height)];
...@@ -654,9 +659,9 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -654,9 +659,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
{ {
[self updateWindow]; [self updateWindow];
if (b_dark_interface) if (b_dark_interface)
[self setContentMinSize:NSMakeSize(604., 288. + [o_titlebar_view frame].size.height)]; [self setContentMinSize:NSMakeSize(604., f_min_window_height + [o_titlebar_view frame].size.height)];
else else
[self setContentMinSize:NSMakeSize(604., 288.)]; [self setContentMinSize:NSMakeSize(604., f_min_window_height)];
[self setContentMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)]; [self setContentMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];
if (b_with_resize) { if (b_with_resize) {
...@@ -667,6 +672,8 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -667,6 +672,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
[self setFrame: winrect display: YES animate: YES]; [self setFrame: winrect display: YES animate: YES];
} }
// cancel pending pl resizes, in case of fast toggle between both modes
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(resizePlaylistAfterCollapse) object:nil];
[self performSelector:@selector(resizePlaylistAfterCollapse) withObject: nil afterDelay:0.75]; [self performSelector:@selector(resizePlaylistAfterCollapse) withObject: nil afterDelay:0.75];
b_splitview_removed = NO; b_splitview_removed = NO;
......
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