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

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

Issue 1010853002: Reset the background of title label when selected by arrow keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: commends addressed Created 5 years, 9 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/app_list_item_view.cc
diff --git a/ui/app_list/views/app_list_item_view.cc b/ui/app_list/views/app_list_item_view.cc
index a4107c1cd1864a3a91706d6baa8be0cb3d1bfa6e..0215149ff9dceae32bcae3080426d06b7dc1c59d 100644
--- a/ui/app_list/views/app_list_item_view.cc
+++ b/ui/app_list/views/app_list_item_view.cc
@@ -205,28 +205,6 @@ void AppListItemView::OnMouseDragTimer() {
SetUIState(UI_STATE_DRAGGING);
}
-void AppListItemView::SetTitleSubpixelAA() {
- // TODO(tapted): Enable AA for folders as well, taking care to play nice with
- // the folder bubble animation.
- bool enable_aa = !is_in_folder_ && ui_state_ == UI_STATE_NORMAL &&
- !is_highlighted_ && !apps_grid_view_->IsSelectedView(this) &&
- !apps_grid_view_->IsAnimatingView(this);
-
- title_->SetSubpixelRenderingEnabled(enable_aa);
- if (enable_aa) {
- title_->SetBackgroundColor(app_list::kLabelBackgroundColor);
- title_->set_background(views::Background::CreateSolidBackground(
- app_list::kLabelBackgroundColor));
- } else {
- // In other cases, keep the background transparent to ensure correct
- // interactions with animations. This will temporarily disable subpixel AA.
- title_->SetBackgroundColor(0);
- title_->set_background(NULL);
- }
- title_->Invalidate();
- title_->SchedulePaint();
-}
-
void AppListItemView::Prerender() {
title_->PaintToBackingImage();
}
@@ -567,6 +545,28 @@ gfx::Rect AppListItemView::GetIconBoundsForTargetViewBounds(
return icon_bounds;
}
+void AppListItemView::SetTitleSubpixelAA() {
+ // TODO(tapted): Enable AA for folders as well, taking care to play nice with
+ // the folder bubble animation.
+ bool enable_aa = !is_in_folder_ && ui_state_ == UI_STATE_NORMAL &&
+ !is_highlighted_ && !apps_grid_view_->IsSelectedView(this) &&
+ !apps_grid_view_->IsAnimatingView(this);
+
+ title_->SetSubpixelRenderingEnabled(enable_aa);
+ if (enable_aa) {
+ title_->SetBackgroundColor(app_list::kLabelBackgroundColor);
+ title_->set_background(views::Background::CreateSolidBackground(
+ app_list::kLabelBackgroundColor));
+ } else {
+ // In other cases, keep the background transparent to ensure correct
+ // interactions with animations. This will temporarily disable subpixel AA.
+ title_->SetBackgroundColor(0);
+ title_->set_background(NULL);
+ }
+ title_->Invalidate();
+ title_->SchedulePaint();
+}
+
void AppListItemView::ItemIconChanged() {
SetIcon(item_weak_->icon(), item_weak_->has_shadow());
}

Powered by Google App Engine
This is Rietveld 408576698