1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

Fix NSAttributedString deprecation (#3330)

This commit is contained in:
FX Coudert 2022-06-20 21:45:01 +02:00 committed by GitHub
parent 83927eade1
commit 2ac049c7ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,9 +38,11 @@ AboutWindowController* fAboutBoxInstance = nil;
self.fCopyrightField.stringValue = [NSBundle.mainBundle localizedStringForKey:@"NSHumanReadableCopyright" value:nil
table:@"InfoPlist"];
[self.fTextView.textStorage
setAttributedString:[[NSAttributedString alloc] initWithPath:[NSBundle.mainBundle pathForResource:@"Credits" ofType:@"rtf"]
documentAttributes:nil]];
NSAttributedString *credits = [[NSAttributedString alloc] initWithURL:[NSBundle.mainBundle URLForResource:@"Credits" withExtension:@"rtf"]
options:@{NSDocumentTypeDocumentAttribute: NSRTFTextDocumentType}
documentAttributes:nil
error:nil];
[self.fTextView.textStorage setAttributedString:credits];
//size license button
CGFloat const oldButtonWidth = NSWidth(self.fLicenseButton.frame);