Commit b5c63f04 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Update TrayContainer's layout manager when necessary

When TrayContainer's child preferredsize/visibility changed,
it wants to emit the PreferredSizeChanged() signal. However,
sometimes TrayContainer may not set the layout manager yet,
which does not update the preferred size and the signal will
be ignored.

I believe that ideally the current code structure/layout logic
should be refactored; the layout manager should always exist
for this view -- but this would be a good fix for the reported
issue of incorrect layout.

BUG=chromium:1100650
TEST=manually

Change-Id: Ifd64e9a8b6823366d54735951e3e4836d65b51d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2284014Reviewed-by: default avatarTim Song <tengs@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786002}
parent ee8173ad
...@@ -76,10 +76,14 @@ void TrayContainer::SetMargin(int main_axis_margin, int cross_axis_margin) { ...@@ -76,10 +76,14 @@ void TrayContainer::SetMargin(int main_axis_margin, int cross_axis_margin) {
} }
void TrayContainer::ChildPreferredSizeChanged(views::View* child) { void TrayContainer::ChildPreferredSizeChanged(views::View* child) {
if (layout_manager_)
UpdateLayout();
PreferredSizeChanged(); PreferredSizeChanged();
} }
void TrayContainer::ChildVisibilityChanged(View* child) { void TrayContainer::ChildVisibilityChanged(View* child) {
if (layout_manager_)
UpdateLayout();
PreferredSizeChanged(); PreferredSizeChanged();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment