Commit 34276fa2 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Separate the opacity of AppsContainerView and PageSwitcher

My CL r681543 removed the layer for PageSwitcher and reused
a new AppsContainerView's layer, but it turned out this was wrong
since the opacity of parent layer affects the descendent layer
opacities.

This CL revives the PageSwitcher layer to recover the original
behavior of the opacity when dragging the app-list. Since all of
AppsContainerView's children have their own layers, this is okay
to be ui::LAYER_NOT_DRAWN and hence it won't affect the drawing
performance.

Bug: 988494
Test: manually
Change-Id: If1913b5fa426b7ee63bb25ac7fef180375cdd30d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1722408Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681903}
parent 134fe606
...@@ -61,8 +61,7 @@ constexpr float kSuggestionChipOpacityEndProgress = 1; ...@@ -61,8 +61,7 @@ constexpr float kSuggestionChipOpacityEndProgress = 1;
AppsContainerView::AppsContainerView(ContentsView* contents_view, AppsContainerView::AppsContainerView(ContentsView* contents_view,
AppListModel* model) AppListModel* model)
: contents_view_(contents_view) { : contents_view_(contents_view) {
SetPaintToLayer(); SetPaintToLayer(ui::LAYER_NOT_DRAWN);
layer()->SetFillsBoundsOpaquely(false);
suggestion_chip_container_view_ = suggestion_chip_container_view_ =
new SuggestionChipContainerView(contents_view); new SuggestionChipContainerView(contents_view);
...@@ -198,7 +197,7 @@ void AppsContainerView::UpdateYPositionAndOpacity() { ...@@ -198,7 +197,7 @@ void AppsContainerView::UpdateYPositionAndOpacity() {
(AppListConfig::instance().all_apps_opacity_end_px() - start_px), (AppListConfig::instance().all_apps_opacity_end_px() - start_px),
0.f), 0.f),
1.0f); 1.0f);
layer()->SetOpacity(should_restore_opacity ? 1.0f : opacity); page_switcher_->layer()->SetOpacity(should_restore_opacity ? 1.0f : opacity);
const float progress = const float progress =
contents_view_->app_list_view()->GetAppListTransitionProgress(); contents_view_->app_list_view()->GetAppListTransitionProgress();
......
...@@ -190,6 +190,8 @@ PageSwitcher::PageSwitcher(ash::PaginationModel* model, ...@@ -190,6 +190,8 @@ PageSwitcher::PageSwitcher(ash::PaginationModel* model,
buttons_(new views::View), buttons_(new views::View),
vertical_(vertical), vertical_(vertical),
is_tablet_mode_(is_tablet_mode) { is_tablet_mode_(is_tablet_mode) {
SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
if (vertical_) { if (vertical_) {
buttons_->SetLayoutManager(std::make_unique<views::BoxLayout>( buttons_->SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kVertical, gfx::Insets(), views::BoxLayout::Orientation::kVertical, gfx::Insets(),
......
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