diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 14:55:09 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 14:55:09 +0000 |
commit | d2f7d56bd62cd8d6a8e50b25dac8f2bc4871eafe (patch) | |
tree | e66610ffde53c34e58f671b92092b69e714268f2 /views/grid_layout.cc | |
parent | fbde2f7efff4198e4138e1f202395dacc1847da6 (diff) | |
download | chromium_src-d2f7d56bd62cd8d6a8e50b25dac8f2bc4871eafe.zip chromium_src-d2f7d56bd62cd8d6a8e50b25dac8f2bc4871eafe.tar.gz chromium_src-d2f7d56bd62cd8d6a8e50b25dac8f2bc4871eafe.tar.bz2 |
Revert r51526 (Auto-size the views version of the options dialog.)
Unexpected unit_tests crash on chromeos.
TBR: mnissler
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/grid_layout.cc')
-rw-r--r-- | views/grid_layout.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/views/grid_layout.cc b/views/grid_layout.cc index 5e685ac..b3f0625 100644 --- a/views/grid_layout.cc +++ b/views/grid_layout.cc @@ -844,26 +844,22 @@ void GridLayout::SizeRowsAndColumns(bool layout, int width, int height, if (rows_.empty()) return; - // Calculate the preferred width of each of the columns. Some views' - // preferred heights are derived from their width, as such we need to - // calculate the size of the columns first. + // Calculate the size of each of the columns. Some views preferred heights are + // derived from their width, as such we need to calculate the size of the + // columns first. for (std::vector<ColumnSet*>::iterator i = column_sets_.begin(); i != column_sets_.end(); ++i) { (*i)->CalculateSize(); + if (layout || width > 0) { + // We're doing a layout, divy up any extra space. + (*i)->Resize(width - (*i)->LayoutWidth() - left_inset_ - right_inset_); + // And reset the x coordinates. + (*i)->ResetColumnXCoordinates(); + } pref->set_width(std::max(pref->width(), (*i)->LayoutWidth())); } pref->set_width(pref->width() + left_inset_ + right_inset_); - // Go over the columns again and set them all to the size we settled for. - width = width ? width : pref->width(); - for (std::vector<ColumnSet*>::iterator i = column_sets_.begin(); - i != column_sets_.end(); ++i) { - // We're doing a layout, divy up any extra space. - (*i)->Resize(width - (*i)->LayoutWidth() - left_inset_ - right_inset_); - // And reset the x coordinates. - (*i)->ResetColumnXCoordinates(); - } - // Reset the height of each row. LayoutElement::ResetSizes(&rows_); @@ -1067,3 +1063,4 @@ views::GridLayout* CreatePanelGridLayout(views::View* host) { kPanelVertMargin, kPanelHorizMargin); return layout; } + |