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
+25

No files matched your search

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