diff --git a/AppKit/CPAlert.j b/AppKit/CPAlert.j index a3e719d68..4ce109051 100644 --- a/AppKit/CPAlert.j +++ b/AppKit/CPAlert.j @@ -365,6 +365,8 @@ CPCriticalAlertStyle = 2; [_messageLabel setFrame:CGRectMake(inset.left, inset.top, textWidth, messageSize.height + sizeWithFontCorrection)]; [_informativeLabel setFrame:CGRectMake(inset.left, CGRectGetMaxY([_messageLabel frame]) + informativeOffset, textWidth, informativeSize.height + sizeWithFontCorrection)]; + // Don't let an empty informative label partially cover the buttons. + [_informativeLabel setHidden:!informationString]; var aRepresentativeButton = _buttons[0], buttonY = MAX(CGRectGetMaxY([_alertImageView frame]), CGRectGetMaxY(informationString ? [_informativeLabel frame] : [_messageLabel frame])) + buttonOffset; // the lower of the bottom of the text and the bottom of the icon. diff --git a/Tests/Manual/CPAlertTest/AppController.j b/Tests/Manual/CPAlertTest/AppController.j index 4467d2fcb..1b7ffe44c 100644 --- a/Tests/Manual/CPAlertTest/AppController.j +++ b/Tests/Manual/CPAlertTest/AppController.j @@ -25,7 +25,10 @@ "Theorise", "Cancel"], [@"Snakes. Why did it have to be snakes?", nil, - "Torch", "Cancel"] + "Torch", "Cancel"], + [@"Sometimes a message can be really long and just appear to go on and on. It could be a speech. It could be the television.", + nil, + "Off", "Cancel"] ]; messageIndex = 0; @@ -69,12 +72,11 @@ if (![variations count]) return; - var variation = variations[0], message = messages[messageIndex], alert = [[CPAlert alloc] init]; - messageIndex = 1 - messageIndex; + messageIndex = (messageIndex + 1) % messages.length; [variations removeObjectAtIndex:0]; [alert setDelegate:self];