some fixes to default buttons to make them more cocoa compliant...

This commit is contained in:
Randall Luecke committed 2010-08-01 20:19:26 -05:00
1 parent bcff25b959
commit 90a45dca29
2 files changed
+11 -2

No files matched your search

+6
View File
@@ -572,9 +572,15 @@ CPButtonStateMixed = CPThemeState("mixed");
// Check if the key equivalent is the enter key
// Treat \r and \n as the same key equivalent. See issue #710.
if (aString === CPNewlineCharacter || aString === CPCarriageReturnCharacter)
{
[[self window] setDefaultButton:self];
[self setDefaultButton:YES];
}
else if ([[self window] defaultButton] === self)
{
[[self window] setDefaultButton:nil];
[self setDefaultButton:NO];
}
_keyEquivalent = aString || @"";
}