Fix things on 10.10 and earlier.

This commit is contained in:
Damiano Galassi committed 2016-01-09 13:37:54 +01:00
1 parent e45dbdab91
commit b9f38cbec0
3 files changed
+40 -15

No files matched your search

+10 -3
View File
@@ -21,9 +21,16 @@
[ps setHeadIndent: -10.0]; [ps setHeadIndent: -10.0];
[ps setAlignment:NSRightTextAlignment]; [ps setAlignment:NSRightTextAlignment];
detailBoldAttr = [@{ NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightBold], if ([[NSFont class] respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) {
NSParagraphStyleAttributeName: ps, detailBoldAttr = [@{ NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightBold],
NSForegroundColorAttributeName: [NSColor grayColor] } retain]; NSParagraphStyleAttributeName: ps,
NSForegroundColorAttributeName: [NSColor grayColor] } retain];
}
else {
detailBoldAttr = [@{ NSFontAttributeName: [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]],
NSParagraphStyleAttributeName: ps,
NSForegroundColorAttributeName: [NSColor grayColor] } retain];
}
chapterTableView.defaultEditingColumn = 1; chapterTableView.defaultEditingColumn = 1;
} }
+18 -5
View File
@@ -56,9 +56,16 @@
ps.headIndent = -10.0; ps.headIndent = -10.0;
ps.alignment = NSTextAlignmentRight; ps.alignment = NSTextAlignmentRight;
_detailBoldMonospacedAttr = [@{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightBold], if ([[NSFont class] respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) {
NSParagraphStyleAttributeName: ps, _detailBoldMonospacedAttr = [@{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightBold],
NSForegroundColorAttributeName: [NSColor grayColor]} retain]; NSParagraphStyleAttributeName: ps,
NSForegroundColorAttributeName: [NSColor grayColor]} retain];
}
else {
_detailBoldMonospacedAttr = [@{NSFontAttributeName: [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]],
NSParagraphStyleAttributeName: ps,
NSForegroundColorAttributeName: [NSColor grayColor]} retain];
}
NSMutableParagraphStyle *psL = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; NSMutableParagraphStyle *psL = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
psL.headIndent = -10.0; psL.headIndent = -10.0;
@@ -68,8 +75,14 @@
NSForegroundColorAttributeName: [NSColor grayColor]} retain]; NSForegroundColorAttributeName: [NSColor grayColor]} retain];
_detailMonospacedAttr = [@{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightRegular], if ([[NSFont class] respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) {
NSParagraphStyleAttributeName: ps} retain]; _detailMonospacedAttr = [@{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightRegular],
NSParagraphStyleAttributeName: ps} retain];
}
else {
_detailMonospacedAttr = [@{NSFontAttributeName: [NSFont systemFontOfSize:[NSFont smallSystemFontSize]],
NSParagraphStyleAttributeName: ps} retain];
}
} }
- (void)windowDidLoad { - (void)windowDidLoad {
+12 -7
View File
@@ -463,16 +463,21 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
if ([tableColumn.identifier isEqualToString:@"trackDuration"]) { if ([tableColumn.identifier isEqualToString:@"trackDuration"]) {
NSFont *font = [NSFont monospacedDigitSystemFontOfSize:[NSFont systemFontSize] weight:NSFontWeightRegular]; if ([[NSFont class] respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) {
NSMutableParagraphStyle *ps = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; NSFont *font = [NSFont monospacedDigitSystemFontOfSize:[NSFont systemFontSize] weight:NSFontWeightRegular];
ps.alignment = NSTextAlignmentRight; NSMutableParagraphStyle *ps = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
ps.alignment = NSTextAlignmentRight;
NSDictionary *monospacedAttr = @{NSFontAttributeName: font, NSDictionary *monospacedAttr = @{NSFontAttributeName: font,
NSParagraphStyleAttributeName: ps}; NSParagraphStyleAttributeName: ps};
[ps release]; [ps release];
return [[[NSAttributedString alloc] initWithString:track.timeString attributes:monospacedAttr] autorelease]; return [[[NSAttributedString alloc] initWithString:track.timeString attributes:monospacedAttr] autorelease];
}
else {
return track.timeString;
}
} }
if ([tableColumn.identifier isEqualToString:@"trackLanguage"]) { if ([tableColumn.identifier isEqualToString:@"trackLanguage"]) {