mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-14 14:41:28 +00:00
Fix for endless loop with default buttons.
This commit is contained in:
+1
-2
@@ -569,6 +569,7 @@ CPButtonStateMixed = CPThemeState("mixed");
|
||||
*/
|
||||
- (void)setKeyEquivalent:(CPString)aString
|
||||
{
|
||||
_keyEquivalent = aString || @"";
|
||||
// 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)
|
||||
@@ -581,8 +582,6 @@ CPButtonStateMixed = CPThemeState("mixed");
|
||||
[[self window] setDefaultButton:nil];
|
||||
[self setDefaultButton:NO];
|
||||
}
|
||||
|
||||
_keyEquivalent = aString || @"";
|
||||
}
|
||||
|
||||
- (void)viewWillMoveToWindow:(CPWindow)aWindow
|
||||
|
||||
@@ -2411,7 +2411,8 @@ CPTexturedBackgroundWindowMask
|
||||
|
||||
_defaultButton = aButton;
|
||||
|
||||
[_defaultButton setKeyEquivalent:CPCarriageReturnCharacter];
|
||||
if ([_defaultButton keyEquivalent] !== CPCarriageReturnCharacter)
|
||||
[_defaultButton setKeyEquivalent:CPCarriageReturnCharacter];
|
||||
}
|
||||
|
||||
- (CPButton)defaultButton
|
||||
|
||||
Reference in New Issue
Block a user