mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-30 14:17:40 +00:00
Fixed: if a CPAlert message was 3 lines or more and there was no informative text, the upper half of the CPAlert buttons would not react to clicks as the blank informative label partially covered them.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user