From d9a4f56fc4454c89c678ec07e90a4194f3343dd8 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 24 Feb 2017 11:26:02 +0100 Subject: [PATCH] Update MP4Dump --- .../MP4Dump/English.lproj/MyDocument.xib | 21 +++++++++---------- Utilities/MP4Dump/MyDocument.h | 4 ++-- Utilities/MP4Dump/MyDocument.m | 15 ++++++++++--- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Utilities/MP4Dump/English.lproj/MyDocument.xib b/Utilities/MP4Dump/English.lproj/MyDocument.xib index e4500fe..cbe5755 100755 --- a/Utilities/MP4Dump/English.lproj/MyDocument.xib +++ b/Utilities/MP4Dump/English.lproj/MyDocument.xib @@ -1,8 +1,9 @@ - - + + - - + + + @@ -13,7 +14,7 @@ - + @@ -30,15 +31,13 @@ - + - - @@ -57,7 +56,7 @@ - + @@ -105,6 +104,6 @@ - + - \ No newline at end of file + diff --git a/Utilities/MP4Dump/MyDocument.h b/Utilities/MP4Dump/MyDocument.h index 334e698..6605b54 100755 --- a/Utilities/MP4Dump/MyDocument.h +++ b/Utilities/MP4Dump/MyDocument.h @@ -13,9 +13,9 @@ { IBOutlet NSTextView * textView; IBOutlet NSPopUpButton *logLevelButton; - NSString * result; + NSString *result; } -- (IBAction) setLogLevel: (id) sender; +- (IBAction)setLogLevel:(id)sender; @end diff --git a/Utilities/MP4Dump/MyDocument.m b/Utilities/MP4Dump/MyDocument.m index b2a63ae..1e1b6f2 100755 --- a/Utilities/MP4Dump/MyDocument.m +++ b/Utilities/MP4Dump/MyDocument.m @@ -11,13 +11,22 @@ extern NSString *libraryPath; +@interface MyDocument () + +@property (nonatomic, readonly) NSDictionary *attributes; + +@end + @implementation MyDocument - (instancetype)init { self = [super init]; if (self) { - + NSMutableParagraphStyle *ps = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; + _attributes = @{ NSFontAttributeName: [NSFont fontWithName:@"Monaco" size:11], + NSParagraphStyleAttributeName: ps, + NSForegroundColorAttributeName: NSColor.textColor }; } return self; } @@ -36,13 +45,13 @@ extern NSString *libraryPath; } [self _resetTextView]; - NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:result]; + + NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:result attributes:self.attributes]; [textView.textStorage appendAttributedString:attributedString]; } - (void)_resetTextView { - textView.font = [NSFont fontWithName:@"Monaco" size:10]; textView.string = @""; [textView setContinuousSpellCheckingEnabled:NO]; }