aboutsummaryrefslogtreecommitdiff
path: root/src/client/mac/sender
diff options
context:
space:
mode:
authorstuart.morgan <stuart.morgan@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-01-05 05:34:47 +0000
committerstuart.morgan <stuart.morgan@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-01-05 05:34:47 +0000
commit816f25011c3f2519e75014b92f00d6c204dcb1ca (patch)
treebd5652482ed7631c3ccbe32cf9fd05933961c1a1 /src/client/mac/sender
parentKeep a log of uploaded crash IDs on the Mac. Review URL: http://breakpad.apps... (diff)
downloadbreakpad-816f25011c3f2519e75014b92f00d6c204dcb1ca.tar.xz
Make localization resizing of Mac uploader email line more robust. Review URL: http://breakpad.appspot.com/247001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@749 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/mac/sender')
-rw-r--r--src/client/mac/sender/crash_report_sender.m23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/client/mac/sender/crash_report_sender.m b/src/client/mac/sender/crash_report_sender.m
index 5bf806a3..e3889761 100644
--- a/src/client/mac/sender/crash_report_sender.m
+++ b/src/client/mac/sender/crash_report_sender.m
@@ -616,17 +616,30 @@ NSString *const kDefaultServerType = @"google";
CGFloat emailLabelWidthDelta = [emailLabel_ breakpad_adjustWidthToFit];
[emailEntryField_ breakpad_shiftHorizontally:emailLabelWidthDelta];
+ // Localize the privacy policy label, and keep it right-aligned to the arrow.
+ [privacyLinkLabel_ setStringValue:NSLocalizedString(@"privacyLabel", @"")];
+ CGFloat privacyLabelWidthDelta =
+ [privacyLinkLabel_ breakpad_adjustWidthToFit];
+ [privacyLinkLabel_ breakpad_shiftHorizontally:(-privacyLabelWidthDelta)];
+
+ // Ensure that the email field and the privacy policy link don't overlap.
+ CGFloat kMinControlPadding = 8;
+ CGFloat maxEmailFieldWidth = NSMinX([privacyLinkLabel_ frame]) -
+ NSMinX([emailEntryField_ frame]) -
+ kMinControlPadding;
+ if (NSWidth([emailEntryField_ bounds]) > maxEmailFieldWidth &&
+ maxEmailFieldWidth > 0) {
+ NSSize emailSize = [emailEntryField_ frame].size;
+ emailSize.width = maxEmailFieldWidth;
+ [emailEntryField_ setFrameSize:emailSize];
+ }
+
// Localize the placeholder text.
[[commentsEntryField_ cell]
setPlaceholderString:NSLocalizedString(@"commentsPlaceholder", @"")];
[[emailEntryField_ cell]
setPlaceholderString:NSLocalizedString(@"emailPlaceholder", @"")];
- // Localize the privacy policy label, and keep it right-aligned to the arrow.
- [privacyLinkLabel_ setStringValue:NSLocalizedString(@"privacyLabel", @"")];
- CGFloat privacyLabelWidthDelta = [privacyLinkLabel_ breakpad_adjustWidthToFit];
- [privacyLinkLabel_ breakpad_shiftHorizontally:(-privacyLabelWidthDelta)];
-
// Localize the buttons, and keep the cancel button at the right distance.
[sendButton_ setTitle:NSLocalizedString(@"sendReportButton", @"")];
CGFloat sendButtonWidthDelta = [sendButton_ breakpad_smartSizeToFit];