summaryrefslogtreecommitdiffstats
path: root/views/controls/table/table_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/table/table_view.cc')
-rw-r--r--views/controls/table/table_view.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/views/controls/table/table_view.cc b/views/controls/table/table_view.cc
index 7ab4c91..8b86a6e 100644
--- a/views/controls/table/table_view.cc
+++ b/views/controls/table/table_view.cc
@@ -64,6 +64,7 @@ TableView::TableView(TableModel* model,
single_selection_(single_selection),
ignore_listview_change_(false),
custom_colors_enabled_(false),
+ sized_columns_(false),
autosize_columns_(autosize_columns),
resizable_columns_(resizable_columns),
list_view_(NULL),
@@ -132,8 +133,10 @@ void TableView::DidChangeBounds(const gfx::Rect& previous,
return;
SendMessage(list_view_, WM_SETREDRAW, static_cast<WPARAM>(FALSE), 0);
Layout();
- if (autosize_columns_ && width() > 0)
+ if ((!sized_columns_ || autosize_columns_) && width() > 0) {
+ sized_columns_ = true;
ResetColumnSizes();
+ }
UpdateContentOffset();
SendMessage(list_view_, WM_SETREDRAW, static_cast<WPARAM>(TRUE), 0);
}
@@ -1548,15 +1551,6 @@ gfx::Font TableView::GetAltTextFont() {
return ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont);
}
-void TableView::VisibilityChanged(View* starting_from, bool is_visible) {
- // GetClientRect as used by ResetColumnSize to obtain the total width
- // available to the columns only works when the native control is visible, so
- // update the column sizes in case we become visible. This depends on
- // VisibilityChanged() being called in post order on the view tree.
- if (is_visible && autosize_columns_)
- ResetColumnSizes();
-}
-
//
// TableSelectionIterator