Fix alternateContents in NSButtonCell (#305)

This commit is contained in:
williameveretteggplant 2024-10-17 00:23:02 -06:00 committed by GitHub
parent 55ef9f465f
commit 9901bbcb4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1752,7 +1752,19 @@
}
if ([aDecoder containsValueForKey: @"NSAlternateContents"])
{
[self setAlternateTitle: [aDecoder decodeObjectForKey: @"NSAlternateContents"]];
id alternateContents = [aDecoder decodeObjectForKey: @"NSAlternateContents"];
if ([alternateContents isKindOfClass:[NSString class]])
{
[self setAlternateTitle:alternateContents];
}
else if ([alternateContents isKindOfClass:[NSImage class]])
{
[self setAlternateImage:alternateContents];
}
else
{
NSLog(@"Invalid class for NSAlternateContents: %@", [alternateContents class]);
}
}
if ([aDecoder containsValueForKey: @"NSButtonFlags"])
{