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

macosx: really fixed the time line drawing artifacts (close #6057)

(cherry picked from commit 55a47406fd1391b61b85b2051951434741e299a9)
parent 3375d109
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<integer value="4722"/> <integer value="4722"/>
<integer value="4850"/> <integer value="4850"/>
<integer value="2770"/> <integer value="2770"/>
<integer value="21"/> <integer value="4756"/>
<integer value="29"/> <integer value="29"/>
<integer value="2730"/> <integer value="2730"/>
<integer value="283"/> <integer value="283"/>
...@@ -672,7 +672,6 @@ ...@@ -672,7 +672,6 @@
<string key="NSFrame">{{218, 11}, {60, 12}}</string> <string key="NSFrame">{{218, 11}, {60, 12}}</string>
<reference key="NSSuperview" ref="129808516"/> <reference key="NSSuperview" ref="129808516"/>
<int key="NSViewLayerContentsRedrawPolicy">2</int> <int key="NSViewLayerContentsRedrawPolicy">2</int>
<bool key="NSViewCanDrawConcurrently">YES</bool>
<string key="NSClassName">VLCThreePartImageView</string> <string key="NSClassName">VLCThreePartImageView</string>
</object> </object>
<object class="NSButton" id="707945673"> <object class="NSButton" id="707945673">
...@@ -1141,7 +1140,6 @@ ...@@ -1141,7 +1140,6 @@
<string key="NSFrame">{{-1, 0}, {605, 36}}</string> <string key="NSFrame">{{-1, 0}, {605, 36}}</string>
<reference key="NSSuperview" ref="429932428"/> <reference key="NSSuperview" ref="429932428"/>
<int key="NSViewLayerContentsRedrawPolicy">2</int> <int key="NSViewLayerContentsRedrawPolicy">2</int>
<bool key="NSViewCanDrawConcurrently">YES</bool>
<string key="NSClassName">VLCThreePartDropView</string> <string key="NSClassName">VLCThreePartDropView</string>
</object> </object>
</object> </object>
......
...@@ -463,6 +463,11 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -463,6 +463,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_sidebar_scrollview setBorderType: NSNoBorder]; [o_sidebar_scrollview setBorderType: NSNoBorder];
} }
NSRect frame;
frame = [o_time_sld_fancygradient_view frame];
frame.size.width = 0;
[o_time_sld_fancygradient_view setFrame: frame];
if (OSX_LION) if (OSX_LION)
[o_resize_view setImage: NULL]; [o_resize_view setImage: NULL];
...@@ -1240,9 +1245,9 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1240,9 +1245,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
NSRect oldFrame = [o_time_sld_fancygradient_view frame]; NSRect oldFrame = [o_time_sld_fancygradient_view frame];
if (f_value != oldFrame.size.width) if (f_value != oldFrame.size.width)
{ {
[o_time_sld_fancygradient_view setHidden: NO]; if ([o_time_sld_fancygradient_view isHidden])
[o_time_sld_fancygradient_view setHidden: NO];
[o_time_sld_fancygradient_view setFrame: NSMakeRect( oldFrame.origin.x, oldFrame.origin.y, f_value, oldFrame.size.height )]; [o_time_sld_fancygradient_view setFrame: NSMakeRect( oldFrame.origin.x, oldFrame.origin.y, f_value, oldFrame.size.height )];
[o_time_sld_fancygradient_view setNeedsDisplay:YES];
} }
} }
else else
......
...@@ -672,6 +672,9 @@ void _drawFrameInRect(NSRect frameRect) ...@@ -672,6 +672,9 @@ void _drawFrameInRect(NSRect frameRect)
- (void)drawRect:(NSRect)rect - (void)drawRect:(NSRect)rect
{ {
[(VLCMainWindow *)[self window] drawFancyGradientEffectForTimeSlider];
msleep( 10000 ); //wait for the gradient to draw completely
/* Draw default to make sure the slider behaves correctly */ /* Draw default to make sure the slider behaves correctly */
[[NSGraphicsContext currentContext] saveGraphicsState]; [[NSGraphicsContext currentContext] saveGraphicsState];
NSRectClip(NSZeroRect); NSRectClip(NSZeroRect);
...@@ -681,8 +684,6 @@ void _drawFrameInRect(NSRect frameRect) ...@@ -681,8 +684,6 @@ void _drawFrameInRect(NSRect frameRect)
NSRect knobRect = [[self cell] knobRectFlipped:NO]; NSRect knobRect = [[self cell] knobRectFlipped:NO];
knobRect.origin.y+=1; knobRect.origin.y+=1;
[self drawKnobInRect: knobRect]; [self drawKnobInRect: knobRect];
[(VLCMainWindow *)[self window] drawFancyGradientEffectForTimeSlider];
} }
@end @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