Commit a1fbd2bd authored by mgiuca's avatar mgiuca Committed by Commit bot

Experimental app list: Remove page indicator.

This is a partial revert of commit 6c4617fc (r282586), "Experimental app
list: Added a current page indicator to the launcher.".

Latest mocks indicate the selected page by changing its icon to blue,
rather than having a blue line above the icon. The reason we are
removing this now is for spacing reasons -- we need to move the grey
separator line up by 1px but the blue line can't be moved up unless we
shrink the contents view.

BUG=411775

Review URL: https://codereview.chromium.org/590023002

Cr-Commit-Position: refs/heads/master@{#295928}
parent 73c43af2
......@@ -80,10 +80,6 @@ const int kReorderDroppingCircleRadius = 35;
// The padding around the outside of the experimental app list (top and sides).
const int kExperimentalWindowPadding = 23;
// Height of separator between the main view and contents switcher and of
// the launcher page indicator.
const int kContentsSwitcherSeparatorHeight = 1;
// Max items allowed in a folder.
size_t kMaxFolderItems = 16;
......
......@@ -60,8 +60,6 @@ APP_LIST_EXPORT extern const int kReorderDroppingCircleRadius;
APP_LIST_EXPORT extern const int kExperimentalWindowPadding;
APP_LIST_EXPORT extern const int kContentsSwitcherSeparatorHeight;
APP_LIST_EXPORT extern size_t kMaxFolderItems;
APP_LIST_EXPORT extern const size_t kNumFolderTopItems;
APP_LIST_EXPORT extern const size_t kMaxFolderNameChars;
......
......@@ -4,13 +4,11 @@
#include "ui/app_list/views/contents_switcher_view.h"
#include "ui/app_list/app_list_constants.h"
#include "ui/app_list/views/contents_view.h"
#include "ui/views/background.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/views/controls/button/custom_button.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
namespace app_list {
......@@ -19,20 +17,6 @@ namespace {
const int kButtonSpacing = 4;
const int kMinimumHeight = 39;
class ContentsPageIndicatorView : public views::View {
public:
ContentsPageIndicatorView() {};
virtual ~ContentsPageIndicatorView() {};
// Overridden from views::View:
virtual gfx::Size GetPreferredSize() const OVERRIDE {
return gfx::Size(0, kContentsSwitcherSeparatorHeight);
};
private:
DISALLOW_COPY_AND_ASSIGN(ContentsPageIndicatorView);
};
} // namespace
ContentsSwitcherView::ContentsSwitcherView(ContentsView* contents_view)
......@@ -53,29 +37,7 @@ void ContentsSwitcherView::AddSwitcherButton(int resource_id, int page_index) {
ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id));
button->set_tag(page_index);
// Add an indicator for the current launcher page.
app_list::ContentsPageIndicatorView* indicator =
new app_list::ContentsPageIndicatorView();
indicator->set_background(
views::Background::CreateSolidBackground(app_list::kPagerSelectedColor));
indicator->SetVisible(false);
page_active_indicators_[page_index] = indicator;
// A container view that will consume space when its child is not visible.
// TODO(calamity): Remove this once BoxLayout supports space-consuming
// invisible views.
views::View* indicator_container = new views::View();
indicator_container->SetLayoutManager(new views::FillLayout());
indicator_container->AddChildView(indicator);
// View containing the indicator view and image button.
views::View* button_container = new views::View();
button_container->SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
button_container->AddChildView(indicator_container);
button_container->AddChildView(button);
AddChildView(button_container);
AddChildView(button);
}
void ContentsSwitcherView::ButtonPressed(views::Button* sender,
......@@ -88,16 +50,7 @@ void ContentsSwitcherView::TotalPagesChanged() {
void ContentsSwitcherView::SelectedPageChanged(int old_selected,
int new_selected) {
// Makes the indicator visible when it is first drawn and when the
// selected page is changed.
std::map<int, views::View*>::const_iterator it =
page_active_indicators_.find(old_selected);
if (it != page_active_indicators_.end())
it->second->SetVisible(false);
it = page_active_indicators_.find(new_selected);
if (it != page_active_indicators_.end())
it->second->SetVisible(true);
// TODO(mgiuca): Visually indicate which page is now selected.
}
void ContentsSwitcherView::TransitionStarted() {
......
......@@ -44,9 +44,6 @@ class ContentsSwitcherView : public views::View,
ContentsView* contents_view_; // Owned by views hierarchy.
// Maps page indices to Views owned by views hierarchy.
std::map<int, views::View*> page_active_indicators_;
DISALLOW_COPY_AND_ASSIGN(ContentsSwitcherView);
};
......
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