Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1091)

Unified Diff: chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm

Issue 9700043: When sizing to fit the extension install dialog title, expand the height instead of the width. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
===================================================================
--- chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm (revision 126752)
+++ chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm (working copy)
@@ -177,16 +177,16 @@
if (![self isBundleInstall])
[iconView_ setImage:prompt_->icon().ToNSImage()];
- // Resize |titleField_| to fit the title.
- CGFloat originalTitleWidth = [titleField_ frame].size.width;
- [titleField_ sizeToFit];
- CGFloat newTitleWidth = [titleField_ frame].size.width;
- if (newTitleWidth > originalTitleWidth) {
- NSRect frame = [[self window] frame];
- frame.size.width += newTitleWidth - originalTitleWidth;
- [[self window] setFrame:frame display:NO];
- }
+ // The dialog is laid out in the NIB exactly how we want it assuming that
+ // each label fits on one line. However, for each label, we want to allow
+ // wrapping onto multiple lines. So we accumulate an offset by measuring how
+ // big each label wants to be, and comparing it to how big it actually is.
+ // Then we shift each label down and resize by the appropriate amount, then
+ // finally resize the window.
+ CGFloat totalOffset = 0.0;
+ OffsetControlVerticallyToFitContent(titleField_, &totalOffset);
+
// Resize |okButton_| and |cancelButton_| to fit the button labels, but keep
// them right-aligned.
NSSize buttonDelta = [GTMUILocalizerAndLayoutTweaker sizeToFitView:okButton_];
@@ -201,14 +201,6 @@
-buttonDelta.width, 0)];
}
- // The dialog is laid out in the NIB exactly how we want it assuming that
- // each label fits on one line. However, for each label, we want to allow
- // wrapping onto multiple lines. So we accumulate an offset by measuring how
- // big each label wants to be, and comparing it to how big it actually is.
- // Then we shift each label down and resize by the appropriate amount, then
- // finally resize the window.
- CGFloat totalOffset = 0.0;
-
if ([self isBundleInstall]) {
[subtitleField_ setStringValue:base::SysUTF16ToNSString(
prompt_->GetPermissionsHeading())];
@@ -228,7 +220,6 @@
[itemsField_ setStringValue:joinedItems];
// Adjust the controls to fit the list of extensions.
- OffsetControlVerticallyToFitContent(titleField_, &totalOffset);
OffsetControlVerticallyToFitContent(itemsField_, &totalOffset);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698