aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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];