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