Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Unified Diff: ui/app_list/views/start_page_view.cc

Issue 2959943003: Replace AllAppsTileItemView with ArrowExpandView (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/app_list/views/start_page_view.cc
diff --git a/ui/app_list/views/start_page_view.cc b/ui/app_list/views/start_page_view.cc
index ed255d7cba6817300533abfc49604fd5e2d5bf5c..f91b0c71b3faf614ee1c942f401efff2417286d0 100644
--- a/ui/app_list/views/start_page_view.cc
+++ b/ui/app_list/views/start_page_view.cc
@@ -23,6 +23,7 @@
#include "ui/app_list/views/app_list_main_view.h"
#include "ui/app_list/views/contents_view.h"
#include "ui/app_list/views/custom_launcher_page_view.h"
+#include "ui/app_list/views/expand_arrow_view.h"
#include "ui/app_list/views/indicator_chip_view.h"
#include "ui/app_list/views/search_box_view.h"
#include "ui/app_list/views/search_result_container_view.h"
@@ -60,7 +61,7 @@ constexpr int kWebViewHeight = 224;
constexpr int kTileSpacing = 7;
constexpr int kNumStartPageTilesCols = 5;
constexpr int kTilesHorizontalMarginLeft = 145;
-constexpr int kCenterColumnOfStartPageAppGrid = 3;
+constexpr int kExpandArrowTopPadding = 28;
constexpr int kLauncherPageBackgroundWidth = 400;
@@ -259,21 +260,16 @@ void StartPageView::StartPageTilesContainer::CreateAppsGrid(int apps_num) {
search_result_tile_views_.emplace_back(tile_item);
}
- all_apps_button_->UpdateIcon();
- if (features::IsFullscreenAppListEnabled()) {
- // Also add a special "all apps" button to the middle of the next row of the
- // container.
- tiles_layout_manager->StartRow(0, 0);
- tiles_layout_manager->SkipColumns(kCenterColumnOfStartPageAppGrid);
- } else {
+ if (!features::IsFullscreenAppListEnabled()) {
+ all_apps_button_->UpdateIcon();
// Also add a special "all apps" button to the end of the next row of the
// container.
if (i % kNumStartPageTilesCols == 0)
tiles_layout_manager->StartRow(0, 0);
- }
- tiles_layout_manager->AddView(all_apps_button_);
- AddChildView(all_apps_button_);
+ tiles_layout_manager->AddView(all_apps_button_);
+ AddChildView(all_apps_button_);
+ }
}
////////////////////////////////////////////////////////////////////////////////
@@ -310,6 +306,11 @@ StartPageView::StartPageView(AppListMainView* app_list_main_view,
// The view containing the start page tiles.
AddChildView(tiles_container_);
+ if (is_fullscreen_app_list_enabled_) {
+ expand_arrow_view_ = new ExpandArrowView(
+ app_list_main_view_->contents_view(), app_list_view);
+ AddChildView(expand_arrow_view_);
+ }
AddChildView(custom_launcher_page_background_);
tiles_container_->SetResults(view_delegate_->GetModel()->results());
@@ -425,6 +426,19 @@ void StartPageView::Layout() {
bounds.set_height(tiles_container_->GetHeightForWidth(bounds.width()));
tiles_container_->SetBoundsRect(bounds);
+ if (expand_arrow_view_) {
+ gfx::Rect expand_arrow_rect(bounds);
+ int left_right_padding =
+ (bounds.width() - expand_arrow_view_->GetPreferredSize().width()) / 2;
+
+ expand_arrow_rect.Inset(left_right_padding,
+ bounds.height() + kExpandArrowTopPadding,
+ left_right_padding, 0);
+ expand_arrow_rect.set_height(
+ expand_arrow_view_->GetPreferredSize().height());
+ expand_arrow_view_->SetBoundsRect(expand_arrow_rect);
+ }
+
CustomLauncherPageView* custom_launcher_page_view =
app_list_main_view_->contents_view()->custom_page_view();
if (!custom_launcher_page_view)
« ui/app_list/views/expand_arrow_view.h ('K') | « ui/app_list/views/start_page_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698