summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-14 16:59:41 +0000
committerthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-14 16:59:41 +0000
commit4e5406e6bb416d20f4262314280c2b9087e8f71d (patch)
tree6910dbc79d24cc70c1b905e61c22a7661fa1e4d6 /chrome/browser/cocoa
parentc6111d56b23a44a981533d0865380bf3bb1e6701 (diff)
downloadchromium_src-4e5406e6bb416d20f4262314280c2b9087e8f71d.zip
chromium_src-4e5406e6bb416d20f4262314280c2b9087e8f71d.tar.gz
chromium_src-4e5406e6bb416d20f4262314280c2b9087e8f71d.tar.bz2
Updates for Under the Hood prefs from Cole:
- Make the scroller the width of the window. - Resize the content so any wrapping text fields have the full width. - Tweak the scroller so only bot bottom border shows. BUG=20538 TEST=Under the hood prefs scroller is the width of the window and goes to the bottom of the toolbar. Review URL: http://codereview.chromium.org/276019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28973 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.mm24
1 files changed, 17 insertions, 7 deletions
diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm
index 11aa419..6227d09 100644
--- a/chrome/browser/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/cocoa/preferences_window_controller.mm
@@ -177,20 +177,30 @@ class PrefObserverBridge : public NotificationObserver {
}
- (void)awakeFromNib {
- // Put the advanced view into the scroller and scroll it to the top.
- [advancedScroller_ setDocumentView:advancedView_];
- NSInteger height = [advancedView_ bounds].size.height;
- [advancedView_ scrollPoint:NSMakePoint(0, height)];
+ NSRect underTheHoodFrame = [underTheHoodView_ frame];
// Make sure the window is wide enough to fit the the widest view
- CGFloat widest = std::max([basicsView_ frame].size.width,
- [personalStuffView_ frame].size.width);
- widest = std::max(widest, [underTheHoodView_ frame].size.width);
+ CGFloat widest = std::max(NSWidth([basicsView_ frame]),
+ NSWidth([personalStuffView_ frame]));
+ widest = std::max(widest, NSWidth(underTheHoodFrame));
NSWindow* prefsWindow = [self window];
NSRect frame = [prefsWindow frame];
frame.size.width = widest;
[prefsWindow setFrame:frame display:NO];
+ // The Under the Hood prefs is a scroller, it shouldn't get any border, so it
+ // gets resized to the as wide as the window ends up.
+ underTheHoodFrame.size.width = widest;
+ [underTheHoodView_ setFrame:underTheHoodFrame];
+ // Widen the Under the Hood content so things can rewrap
+ NSSize advancedContentSize = [advancedView_ frame].size;
+ advancedContentSize.width = [advancedScroller_ contentSize].width;
+ [advancedView_ setFrameSize:advancedContentSize];
+
+ // Put the advanced view into the scroller and scroll it to the top.
+ [advancedScroller_ setDocumentView:advancedView_];
+ [advancedView_ scrollPoint:NSMakePoint(0, advancedContentSize.height)];
+
// Adjust the view origins so they show up centered.
CenterViewForWidth(basicsView_, widest);
CenterViewForWidth(personalStuffView_, widest);