vlc | branch: master | Marvin Scholz <[email protected]> | Thu Jun 1 11:35:50 2017 +0200| [46b71ee295ad617c0405651aad451404f6e3b40f] | committer: Marvin Scholz
macOS: Remove unnecessary styling from VLCTimeField If this is desired, it should be done on a case-by-case base and not included in this subclass, as it is useful in a number of different locations where the click to show alternate time functionality is desired. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=46b71ee295ad617c0405651aad451404f6e3b40f --- modules/gui/macosx/misc.m | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m index 32a2ac90e0..3b659a9294 100644 --- a/modules/gui/macosx/misc.m +++ b/modules/gui/macosx/misc.m @@ -470,11 +470,8 @@ void _drawFrameInRect(NSRect frameRect) * we need this to catch our click-event in the controller window *****************************************************************************/ -@interface VLCTimeField() +@interface VLCTimeField () { - NSShadow * o_string_shadow; - NSTextAlignment textAlignment; - NSString *o_remaining_identifier; BOOL b_time_remaining; } @@ -492,35 +489,13 @@ void _drawFrameInRect(NSRect frameRect) [defaults registerDefaults:appDefaults]; } + - (void)setRemainingIdentifier:(NSString *)o_string { o_remaining_identifier = o_string; b_time_remaining = [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier]; } -- (void)setAlignment:(NSTextAlignment)alignment -{ - textAlignment = alignment; - [self setStringValue:[self stringValue]]; -} - -- (void)setStringValue:(NSString *)string -{ - if (!o_string_shadow) { - o_string_shadow = [[NSShadow alloc] init]; - [o_string_shadow setShadowColor: [NSColor colorWithCalibratedWhite:1.0 alpha:0.5]]; - [o_string_shadow setShadowOffset:NSMakeSize(0.0, -1.0)]; - [o_string_shadow setShadowBlurRadius:0.0]; - } - - NSMutableAttributedString *o_attributed_string = [[NSMutableAttributedString alloc] initWithString:string attributes: nil]; - NSUInteger i_stringLength = [string length]; - - [o_attributed_string addAttribute: NSShadowAttributeName value: o_string_shadow range: NSMakeRange(0, i_stringLength)]; - [o_attributed_string setAlignment: textAlignment range: NSMakeRange(0, i_stringLength)]; - [self setAttributedStringValue: o_attributed_string]; -} - - (void)mouseDown: (NSEvent *)ourEvent { if ( [ourEvent clickCount] > 1 ) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
