Commit b210f592 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fit the apps grid in small size display

1. Scale down apps grid view when it does not fit inside small display
   via transform.
2. Remove box layout in app list main view to avoid duplicate layouts
   in each dragging frame.
3. Update Y position of views instead of calling Layout function during
   dragging to avoid jitter issue due to rounding error.
4. Avoid resizing apps grid view in dragging and animation, which is an
   expensive operation.

Bug: 881851
Change-Id: I78e2605727e8c7f0d93177bcf8877d796b746b86
Reviewed-on: https://chromium-review.googlesource.com/c/1259463
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596724}
parent c9bd3947
...@@ -213,7 +213,7 @@ void AppListPresenterImpl::EndDragFromShelf(AppListViewState app_list_state) { ...@@ -213,7 +213,7 @@ void AppListPresenterImpl::EndDragFromShelf(AppListViewState app_list_state) {
view_->SetState(AppListViewState(app_list_state)); view_->SetState(AppListViewState(app_list_state));
} }
view_->SetIsInDrag(false); view_->SetIsInDrag(false);
view_->DraggingLayout(); view_->UpdateChildViewsYPositionAndOpacity();
} }
} }
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "ui/views/border.h" #include "ui/views/border.h"
#include "ui/views/controls/button/button.h" #include "ui/views/controls/button/button.h"
#include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h" #include "ui/views/layout/fill_layout.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
#include "ui/wm/public/activation_client.h" #include "ui/wm/public/activation_client.h"
...@@ -53,8 +52,6 @@ AppListMainView::AppListMainView(AppListViewDelegate* delegate, ...@@ -53,8 +52,6 @@ AppListMainView::AppListMainView(AppListViewDelegate* delegate,
search_box_view_(nullptr), search_box_view_(nullptr),
contents_view_(nullptr), contents_view_(nullptr),
app_list_view_(app_list_view) { app_list_view_(app_list_view) {
SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::kVertical, gfx::Insets(), 0));
model_->AddObserver(this); model_->AddObserver(this);
} }
...@@ -149,6 +146,12 @@ const char* AppListMainView::GetClassName() const { ...@@ -149,6 +146,12 @@ const char* AppListMainView::GetClassName() const {
return "AppListMainView"; return "AppListMainView";
} }
void AppListMainView::Layout() {
gfx::Rect rect = GetContentsBounds();
if (!rect.IsEmpty())
contents_view_->SetBoundsRect(rect);
}
void AppListMainView::ActivateApp(AppListItem* item, int event_flags) { void AppListMainView::ActivateApp(AppListItem* item, int event_flags) {
// TODO(jennyz): Activate the folder via AppListModel notification. // TODO(jennyz): Activate the folder via AppListModel notification.
if (item->GetItemType() == AppListFolderItem::kItemType) { if (item->GetItemType() == AppListFolderItem::kItemType) {
......
...@@ -68,6 +68,7 @@ class APP_LIST_EXPORT AppListMainView ...@@ -68,6 +68,7 @@ class APP_LIST_EXPORT AppListMainView
// Overridden from views::View: // Overridden from views::View:
const char* GetClassName() const override; const char* GetClassName() const override;
void Layout() override;
// Invoked when an item is activated on the grid view. |event_flags| contains // Invoked when an item is activated on the grid view. |event_flags| contains
// the flags of the keyboard/mouse event that triggers the activation request. // the flags of the keyboard/mouse event that triggers the activation request.
......
...@@ -503,8 +503,6 @@ void AppListView::Layout() { ...@@ -503,8 +503,6 @@ void AppListView::Layout() {
app_list_main_view_->SetBoundsRect(centered_bounds); app_list_main_view_->SetBoundsRect(centered_bounds);
contents_view->Layout();
gfx::Rect app_list_background_shield_bounds = contents_bounds; gfx::Rect app_list_background_shield_bounds = contents_bounds;
// Inset bottom by 2 * |kAppListBackgroundRadius| to account for the rounded // Inset bottom by 2 * |kAppListBackgroundRadius| to account for the rounded
// corners on the top and bottom of the |app_list_background_shield_|. // corners on the top and bottom of the |app_list_background_shield_|.
...@@ -865,7 +863,7 @@ void AppListView::EndDrag(const gfx::Point& location) { ...@@ -865,7 +863,7 @@ void AppListView::EndDrag(const gfx::Point& location) {
} }
} }
drag_started_from_peeking_ = false; drag_started_from_peeking_ = false;
DraggingLayout(); UpdateChildViewsYPositionAndOpacity();
initial_drag_point_ = gfx::Point(); initial_drag_point_ = gfx::Point();
} }
...@@ -1186,7 +1184,7 @@ void AppListView::OnTabletModeChanged(bool started) { ...@@ -1186,7 +1184,7 @@ void AppListView::OnTabletModeChanged(bool started) {
if (is_in_drag_) { if (is_in_drag_) {
SetIsInDrag(false); SetIsInDrag(false);
DraggingLayout(); UpdateChildViewsYPositionAndOpacity();
} }
// Set fullscreen state. When current state is fullscreen, we still need to // Set fullscreen state. When current state is fullscreen, we still need to
...@@ -1375,6 +1373,7 @@ void AppListView::StartAnimationForState(AppListViewState target_state) { ...@@ -1375,6 +1373,7 @@ void AppListView::StartAnimationForState(AppListViewState target_state) {
// In transition animation, layout is only performed after it is complete, // In transition animation, layout is only performed after it is complete,
// which makes the child views jump. So layout in advance here to avoid that. // which makes the child views jump. So layout in advance here to avoid that.
GetAppsContainerView()->InvalidateLayout();
Layout(); Layout();
} }
...@@ -1463,7 +1462,7 @@ void AppListView::UpdateYPositionAndOpacity(int y_position_in_screen, ...@@ -1463,7 +1462,7 @@ void AppListView::UpdateYPositionAndOpacity(int y_position_in_screen,
::wm::ConvertRectFromScreen(native_view->parent(), &new_widget_bounds); ::wm::ConvertRectFromScreen(native_view->parent(), &new_widget_bounds);
native_view->SetBounds(new_widget_bounds); native_view->SetBounds(new_widget_bounds);
DraggingLayout(); UpdateChildViewsYPositionAndOpacity();
} }
void AppListView::OffsetYPositionOfAppList(int offset) { void AppListView::OffsetYPositionOfAppList(int offset) {
...@@ -1542,20 +1541,30 @@ bool AppListView::IsHomeLauncherEnabledInTabletMode() const { ...@@ -1542,20 +1541,30 @@ bool AppListView::IsHomeLauncherEnabledInTabletMode() const {
return is_tablet_mode_ && is_home_launcher_enabled_; return is_tablet_mode_ && is_home_launcher_enabled_;
} }
void AppListView::DraggingLayout() { void AppListView::UpdateChildViewsYPositionAndOpacity() {
if (app_list_state_ == AppListViewState::CLOSED) if (app_list_state_ == AppListViewState::CLOSED)
return; return;
// Update the Y position of the background shield.
float app_list_transition_progress = GetAppListTransitionProgress();
gfx::Transform transform;
if (app_list_transition_progress >= 1 && app_list_transition_progress <= 2) {
// Translate background shield so that it ends drag at y position
// -|kAppListBackgroundRadius| when dragging between peeking and fullscreen.
transform.Translate(
0, -kAppListBackgroundRadius * (app_list_transition_progress - 1));
}
app_list_background_shield_->SetTransform(transform);
// Update the opacity of the background shield.
float shield_opacity = float shield_opacity =
is_background_blur_enabled_ ? kAppListOpacityWithBlur : kAppListOpacity; is_background_blur_enabled_ ? kAppListOpacityWithBlur : kAppListOpacity;
app_list_background_shield_->layer()->SetOpacity( app_list_background_shield_->layer()->SetOpacity(
is_in_drag_ ? background_opacity_ : shield_opacity); is_in_drag_ ? background_opacity_ : shield_opacity);
// Updates the opacity of the items in the app list.
search_box_view_->UpdateOpacity(); search_box_view_->UpdateOpacity();
app_list_main_view_->contents_view()->UpdateOpacity();
Layout(); app_list_main_view_->contents_view()->UpdateYPositionAndOpacity();
} }
void AppListView::RedirectKeyEventToSearchBox(ui::KeyEvent* event) { void AppListView::RedirectKeyEventToSearchBox(ui::KeyEvent* event) {
......
...@@ -169,15 +169,15 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView, ...@@ -169,15 +169,15 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView,
void SetStateFromSearchBoxView(bool search_box_is_empty, void SetStateFromSearchBoxView(bool search_box_is_empty,
bool triggered_by_contents_change); bool triggered_by_contents_change);
// Updates y position and opacity of app list. // Updates y position and opacity of app list during dragging.
void UpdateYPositionAndOpacity(int y_position_in_screen, void UpdateYPositionAndOpacity(int y_position_in_screen,
float background_opacity); float background_opacity);
// Offsets the y position of the app list (above the screen) // Offsets the y position of the app list (above the screen)
void OffsetYPositionOfAppList(int offset); void OffsetYPositionOfAppList(int offset);
// Layouts the app list during dragging. // Update Y position and opacity of this view's child views during dragging.
void DraggingLayout(); void UpdateChildViewsYPositionAndOpacity();
// The search box cannot actively listen to all key events. To control and // The search box cannot actively listen to all key events. To control and
// input into the search box when it does not have focus, we need to redirect // input into the search box when it does not have focus, we need to redirect
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/chromeos/search_box/search_box_constants.h" #include "ui/chromeos/search_box/search_box_constants.h"
#include "ui/events/event.h" #include "ui/events/event.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/strings/grit/ui_strings.h" #include "ui/strings/grit/ui_strings.h"
#include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield.h"
...@@ -163,7 +164,7 @@ void AppsContainerView::UpdateControlVisibility(AppListViewState app_list_state, ...@@ -163,7 +164,7 @@ void AppsContainerView::UpdateControlVisibility(AppListViewState app_list_state,
} }
} }
void AppsContainerView::UpdateOpacity() { void AppsContainerView::UpdateYPositionAndOpacity() {
apps_grid_view_->UpdateOpacity(); apps_grid_view_->UpdateOpacity();
// Updates the opacity of page switcher buttons. The same rule as all apps in // Updates the opacity of page switcher buttons. The same rule as all apps in
...@@ -197,6 +198,14 @@ void AppsContainerView::UpdateOpacity() { ...@@ -197,6 +198,14 @@ void AppsContainerView::UpdateOpacity() {
1.0f); 1.0f);
suggestion_chip_container_view_->layer()->SetOpacity( suggestion_chip_container_view_->layer()->SetOpacity(
should_restore_opacity ? 1.0f : chips_opacity); should_restore_opacity ? 1.0f : chips_opacity);
suggestion_chip_container_view_->SetY(GetExpectedSuggestionChipY(
contents_view_->app_list_view()->GetAppListTransitionProgress()));
apps_grid_view_->SetY(suggestion_chip_container_view_->y() +
chip_grid_y_distance_);
page_switcher_->SetY(suggestion_chip_container_view_->bounds().bottom());
} }
} }
...@@ -221,22 +230,17 @@ void AppsContainerView::Layout() { ...@@ -221,22 +230,17 @@ void AppsContainerView::Layout() {
if (is_new_style_launcher_enabled_) { if (is_new_style_launcher_enabled_) {
// Layout suggestion chips. // Layout suggestion chips.
gfx::Rect chip_container_rect(rect); gfx::Rect chip_container_rect(rect);
const float progress = chip_container_rect.set_y(GetExpectedSuggestionChipY(
contents_view_->app_list_view()->GetAppListTransitionProgress(); contents_view_->app_list_view()->GetAppListTransitionProgress()));
if (progress <= 1) {
// Currently transition progress is between closed and peeking state.
chip_container_rect.set_y(gfx::Tween::IntValueBetween(
progress, 0, kSuggestionChipPeekingY));
} else {
// Currently transition progress is between peeking and fullscreen
// state.
chip_container_rect.set_y(
gfx::Tween::IntValueBetween(progress - 1, kSuggestionChipPeekingY,
kSuggestionChipFullscreenY));
}
chip_container_rect.set_height(kSuggestionChipContainerHeight); chip_container_rect.set_height(kSuggestionChipContainerHeight);
suggestion_chip_container_view_->SetBoundsRect(chip_container_rect); suggestion_chip_container_view_->SetBoundsRect(chip_container_rect);
rect.Inset(0, chip_container_rect.bottom(), 0, 0);
// Leave the same available bounds for the apps grid view in both
// fullscreen and peeking state to avoid resizing the view during
// animation and dragging, which is an expensive operation.
rect.set_y(chip_container_rect.bottom());
rect.set_height(rect.height() - kSuggestionChipFullscreenY -
kSuggestionChipContainerHeight);
} }
// Layout apps grid. // Layout apps grid.
...@@ -280,11 +284,44 @@ void AppsContainerView::Layout() { ...@@ -280,11 +284,44 @@ void AppsContainerView::Layout() {
grid_rect.Inset(horizontal_margin, vertical_margin); grid_rect.Inset(horizontal_margin, vertical_margin);
grid_rect.ClampToCenteredSize( grid_rect.ClampToCenteredSize(
apps_grid_view_->GetMaximumTileGridSize()); apps_grid_view_->GetMaximumTileGridSize());
grid_rect.Inset(-apps_grid_view_->GetInsets());
if ((grid_rect.width() > 0 && grid_rect.height() > 0) &&
(grid_rect.width() < min_grid_size.width() ||
grid_rect.height() < min_grid_size.height())) {
// If the minimum size does not fit inside available bounds, scale
// down the apps grid view via transform while keep the minimum size.
const gfx::Insets insets = apps_grid_view_->GetInsets();
const float scale =
std::min((grid_rect.width()) /
static_cast<float>(min_grid_size.width() +
insets.left() + insets.right()),
grid_rect.height() /
static_cast<float>(min_grid_size.height() +
insets.top() + insets.bottom()));
DCHECK_GT(scale, 0);
const gfx::RectF scaled_grid_rect(grid_rect.x(), grid_rect.y(),
grid_rect.width() / scale,
grid_rect.height() / scale);
gfx::Transform transform;
transform.Scale(scale, scale);
apps_grid_view_->SetTransform(transform);
apps_grid_view_->SetBoundsRect(gfx::ToEnclosedRect(scaled_grid_rect));
} else {
grid_rect.Inset(-apps_grid_view_->GetInsets());
apps_grid_view_->SetTransform(gfx::Transform());
apps_grid_view_->SetBoundsRect(grid_rect);
}
// Record the distance of y position between suggestion chip container
// and apps grid view to avoid duplicate calculation of apps grid view's
// y position during dragging.
chip_grid_y_distance_ =
apps_grid_view_->y() - suggestion_chip_container_view_->y();
} else { } else {
grid_rect.Inset(kAppsGridLeftRightPadding, 0); grid_rect.Inset(kAppsGridLeftRightPadding, 0);
apps_grid_view_->SetBoundsRect(grid_rect);
} }
apps_grid_view_->SetBoundsRect(grid_rect);
// Layout page switcher. // Layout page switcher.
gfx::Rect page_switcher_rect = rect; gfx::Rect page_switcher_rect = rect;
...@@ -528,4 +565,16 @@ void AppsContainerView::DisableFocusForShowingActiveFolder(bool disabled) { ...@@ -528,4 +565,16 @@ void AppsContainerView::DisableFocusForShowingActiveFolder(bool disabled) {
apps_grid_view_->DisableFocusForShowingActiveFolder(disabled); apps_grid_view_->DisableFocusForShowingActiveFolder(disabled);
} }
int AppsContainerView::GetExpectedSuggestionChipY(float progress) {
if (progress <= 1) {
// Currently transition progress is between closed and peeking state.
return gfx::Tween::IntValueBetween(progress, 0, kSuggestionChipPeekingY);
}
// Currently transition progress is between peeking and fullscreen
// state.
return gfx::Tween::IntValueBetween(progress - 1, kSuggestionChipPeekingY,
kSuggestionChipFullscreenY);
}
} // namespace app_list } // namespace app_list
...@@ -66,8 +66,8 @@ class APP_LIST_EXPORT AppsContainerView : public HorizontalPage { ...@@ -66,8 +66,8 @@ class APP_LIST_EXPORT AppsContainerView : public HorizontalPage {
void UpdateControlVisibility(AppListViewState app_list_state, void UpdateControlVisibility(AppListViewState app_list_state,
bool is_in_drag); bool is_in_drag);
// Updates the opacity of the items in this view during dragging. // Updates y position and opacity of the items in this view during dragging.
void UpdateOpacity(); void UpdateYPositionAndOpacity();
// views::View overrides: // views::View overrides:
gfx::Size CalculatePreferredSize() const override; gfx::Size CalculatePreferredSize() const override;
...@@ -117,6 +117,10 @@ class APP_LIST_EXPORT AppsContainerView : public HorizontalPage { ...@@ -117,6 +117,10 @@ class APP_LIST_EXPORT AppsContainerView : public HorizontalPage {
// true. This is used to trap focus within the folder when it is opened. // true. This is used to trap focus within the folder when it is opened.
void DisableFocusForShowingActiveFolder(bool disabled); void DisableFocusForShowingActiveFolder(bool disabled);
// Returns expected suggestion chip container's y position based on the app
// list transition progress.
int GetExpectedSuggestionChipY(float progress);
ContentsView* contents_view_; // Not owned. ContentsView* contents_view_; // Not owned.
// True if new style launcher feature is enabled. // True if new style launcher feature is enabled.
...@@ -131,6 +135,11 @@ class APP_LIST_EXPORT AppsContainerView : public HorizontalPage { ...@@ -131,6 +135,11 @@ class APP_LIST_EXPORT AppsContainerView : public HorizontalPage {
ShowState show_state_ = SHOW_NONE; ShowState show_state_ = SHOW_NONE;
// The distance between y position of suggestion chip container and apps grid
// view. This is used in dragging to avoid duplicate calculation of apps grid
// view's y position.
int chip_grid_y_distance_ = 0;
DISALLOW_COPY_AND_ASSIGN(AppsContainerView); DISALLOW_COPY_AND_ASSIGN(AppsContainerView);
}; };
......
...@@ -2044,11 +2044,12 @@ void AppsGridView::StartDragAndDropHostDrag(const gfx::Point& grid_location) { ...@@ -2044,11 +2044,12 @@ void AppsGridView::StartDragAndDropHostDrag(const gfx::Point& grid_location) {
delta.set_y(delta.y() + drag_view_->title()->size().height() / 2); delta.set_y(delta.y() + drag_view_->title()->size().height() / 2);
// We have to hide the original item since the drag and drop host will do // We have to hide the original item since the drag and drop host will do
// the OS dependent code to "lift off the dragged item". // the OS dependent code to "lift off the dragged item". Apply the scale
// factor of this view's transform to the dragged view as well.
DCHECK(!IsDraggingForReparentInRootLevelGridView()); DCHECK(!IsDraggingForReparentInRootLevelGridView());
drag_and_drop_host_->CreateDragIconProxyByLocationWithNoAnimation( drag_and_drop_host_->CreateDragIconProxyByLocationWithNoAnimation(
drag_view_->GetIconBoundsInScreen().origin(), drag_view_->GetIconImage(), drag_view_->GetIconBoundsInScreen().origin(), drag_view_->GetIconImage(),
drag_view_, kDragAndDropProxyScale, drag_view_, kDragAndDropProxyScale * GetTransform().Scale2d().x(),
is_new_style_launcher_enabled_ && drag_view_->item()->is_folder() is_new_style_launcher_enabled_ && drag_view_->item()->is_folder()
? AppListConfig::instance().blur_radius() ? AppListConfig::instance().blur_radius()
: 0); : 0);
......
...@@ -493,7 +493,7 @@ void ContentsView::Layout() { ...@@ -493,7 +493,7 @@ void ContentsView::Layout() {
if (expand_arrow_view_) { if (expand_arrow_view_) {
// Layout expand arrow. // Layout expand arrow.
gfx::Rect arrow_rect(rect); gfx::Rect arrow_rect(GetContentsBounds());
const gfx::Size arrow_size(expand_arrow_view_->GetPreferredSize()); const gfx::Size arrow_size(expand_arrow_view_->GetPreferredSize());
arrow_rect.set_height(arrow_size.height()); arrow_rect.set_height(arrow_size.height());
arrow_rect.ClampToCenteredSize(arrow_size); arrow_rect.ClampToCenteredSize(arrow_size);
...@@ -542,7 +542,14 @@ views::View* ContentsView::GetSelectedView() const { ...@@ -542,7 +542,14 @@ views::View* ContentsView::GetSelectedView() const {
return app_list_pages_[GetActivePageIndex()]->GetSelectedView(); return app_list_pages_[GetActivePageIndex()]->GetSelectedView();
} }
void ContentsView::UpdateOpacity() { void ContentsView::UpdateYPositionAndOpacity() {
AppListViewState state = app_list_view_->app_list_state();
if (state == AppListViewState::CLOSED ||
state == AppListViewState::FULLSCREEN_SEARCH ||
state == AppListViewState::HALF) {
return;
}
if (expand_arrow_view_) { if (expand_arrow_view_) {
const bool should_restore_opacity = const bool should_restore_opacity =
!app_list_view_->is_in_drag() && !app_list_view_->is_in_drag() &&
...@@ -561,9 +568,21 @@ void ContentsView::UpdateOpacity() { ...@@ -561,9 +568,21 @@ void ContentsView::UpdateOpacity() {
kExpandArrowOpacityStartProgress), kExpandArrowOpacityStartProgress),
0.f), 0.f),
1.0f)); 1.0f));
expand_arrow_view_->SchedulePaint();
} }
GetAppsContainerView()->UpdateOpacity(); AppsContainerView* apps_container_view = GetAppsContainerView();
SearchBoxView* search_box = GetSearchBoxView();
search_box->GetWidget()->SetBounds(
search_box->GetViewBoundsForSearchBoxContentsBounds(
ConvertRectToWidgetWithoutTransform(
apps_container_view->GetSearchBoxExpectedBounds())));
search_results_page_view()->SetBoundsRect(
apps_container_view->GetSearchBoxExpectedBounds());
apps_container_view->UpdateYPositionAndOpacity();
} }
bool ContentsView::ShouldLayoutPage(AppListPage* page, bool ContentsView::ShouldLayoutPage(AppListPage* page,
......
...@@ -166,8 +166,8 @@ class APP_LIST_EXPORT ContentsView : public views::View, ...@@ -166,8 +166,8 @@ class APP_LIST_EXPORT ContentsView : public views::View,
// Returns selected view in active page. // Returns selected view in active page.
views::View* GetSelectedView() const; views::View* GetSelectedView() const;
// Updates the opacity of the items in this view during dragging. // Updates y position and opacity of the items in this view during dragging.
void UpdateOpacity(); void UpdateYPositionAndOpacity();
private: private:
// Sets the active launcher page, accounting for whether the change is for // Sets the active launcher page, accounting for whether the change is for
......
...@@ -55,7 +55,6 @@ void HorizontalPageContainer::Layout() { ...@@ -55,7 +55,6 @@ void HorizontalPageContainer::Layout() {
gfx::Rect page_bounds( gfx::Rect page_bounds(
page->GetPageBoundsForState(contents_view_->GetActiveState())); page->GetPageBoundsForState(contents_view_->GetActiveState()));
page_bounds.Offset(GetOffsetForPageIndex(i)); page_bounds.Offset(GetOffsetForPageIndex(i));
page->InvalidateLayout();
page->SetBoundsRect(page_bounds); page->SetBoundsRect(page_bounds);
} }
} }
...@@ -81,7 +80,6 @@ void HorizontalPageContainer::OnAnimationUpdated(double progress, ...@@ -81,7 +80,6 @@ void HorizontalPageContainer::OnAnimationUpdated(double progress,
gfx::Rect bounds( gfx::Rect bounds(
gfx::Tween::RectValueBetween(progress, from_rect, to_rect)); gfx::Tween::RectValueBetween(progress, from_rect, to_rect));
bounds.Offset(GetOffsetForPageIndex(i)); bounds.Offset(GetOffsetForPageIndex(i));
page->InvalidateLayout();
page->SetBoundsRect(bounds); page->SetBoundsRect(bounds);
} }
} }
......
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