summaryrefslogtreecommitdiffstats
path: root/ui/app_list
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-05 00:45:53 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-05 00:45:53 +0000
commit83f072ace2d0e517f186633c9ac8bc79f20b61f8 (patch)
tree2d5bc0c5a7c95a131ae99da9ce9b65bb1878a442 /ui/app_list
parentcd31c7f8e4514670ac8618afd1450c9146feff70 (diff)
downloadchromium_src-83f072ace2d0e517f186633c9ac8bc79f20b61f8.zip
chromium_src-83f072ace2d0e517f186633c9ac8bc79f20b61f8.tar.gz
chromium_src-83f072ace2d0e517f186633c9ac8bc79f20b61f8.tar.bz2
app_list: Paint background for app item title.
So that they are not drawn on transparency and have artifacts. BUG=146221 TEST=Verify no artifacts around app item title. R=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/10919076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/app_list')
-rw-r--r--ui/app_list/app_list.gyp2
-rw-r--r--ui/app_list/app_list_bubble_border.cc4
-rw-r--r--ui/app_list/app_list_constants.cc11
-rw-r--r--ui/app_list/app_list_constants.h17
-rw-r--r--ui/app_list/app_list_item_view.cc2
-rw-r--r--ui/app_list/search_result_view.cc4
6 files changed, 36 insertions, 4 deletions
diff --git a/ui/app_list/app_list.gyp b/ui/app_list/app_list.gyp
index 2210ded..267d46e 100644
--- a/ui/app_list/app_list.gyp
+++ b/ui/app_list/app_list.gyp
@@ -24,6 +24,8 @@
'sources': [
'app_list_bubble_border.cc',
'app_list_bubble_border.h',
+ 'app_list_constants.cc',
+ 'app_list_constants.h',
'app_list_export.h',
'app_list_item_model.cc',
'app_list_item_model.h',
diff --git a/ui/app_list/app_list_bubble_border.cc b/ui/app_list/app_list_bubble_border.cc
index 4854179..1544f52 100644
--- a/ui/app_list/app_list_bubble_border.cc
+++ b/ui/app_list/app_list_bubble_border.cc
@@ -7,6 +7,7 @@
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
+#include "ui/app_list/app_list_constants.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/path.h"
#include "ui/gfx/skia_util.h"
@@ -14,7 +15,6 @@
namespace {
const SkColor kSearchBoxBackground = SK_ColorWHITE;
-const SkColor kContentsBackground = SkColorSetRGB(0xF5, 0xF5, 0xF5);
// Colors and sizes of top separator between searchbox and grid view.
const SkColor kTopSeparatorColor = SkColorSetRGB(0xF0, 0xF0, 0xF0);
@@ -58,7 +58,7 @@ void AppListBubbleBorder::PaintBackground(gfx::Canvas* canvas,
bounds.width(),
bounds.bottom() - seperator_rect.bottom());
- paint.setColor(kContentsBackground);
+ paint.setColor(kContentsBackgroundColor);
canvas->DrawRect(contents_rect, paint);
}
diff --git a/ui/app_list/app_list_constants.cc b/ui/app_list/app_list_constants.cc
new file mode 100644
index 0000000..2d7e765
--- /dev/null
+++ b/ui/app_list/app_list_constants.cc
@@ -0,0 +1,11 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/app_list/app_list_constants.h"
+
+namespace app_list {
+
+const SkColor kContentsBackgroundColor = SkColorSetRGB(0xF5, 0xF5, 0xF5);
+
+} // namespace app_list
diff --git a/ui/app_list/app_list_constants.h b/ui/app_list/app_list_constants.h
new file mode 100644
index 0000000..90e3901
--- /dev/null
+++ b/ui/app_list/app_list_constants.h
@@ -0,0 +1,17 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_APP_LIST_APP_LIST_CONSTANTS_H_
+#define UI_APP_LIST_APP_LIST_CONSTANTS_H_
+
+#include "third_party/skia/include/core/SkColor.h"
+#include "ui/app_list/app_list_export.h"
+
+namespace app_list {
+
+APP_LIST_EXPORT extern const SkColor kContentsBackgroundColor;
+
+} // namespace app_list
+
+#endif // UI_APP_LIST_APP_LIST_CONSTANTS_H_
diff --git a/ui/app_list/app_list_item_view.cc b/ui/app_list/app_list_item_view.cc
index 995ce7b..1fe599b 100644
--- a/ui/app_list/app_list_item_view.cc
+++ b/ui/app_list/app_list_item_view.cc
@@ -11,6 +11,7 @@
#include "base/synchronization/cancellation_flag.h"
#include "base/threading/worker_pool.h"
#include "base/utf_string_conversions.h"
+#include "ui/app_list/app_list_constants.h"
#include "ui/app_list/app_list_item_model.h"
#include "ui/app_list/apps_grid_view.h"
#include "ui/app_list/drop_shadow_label.h"
@@ -260,6 +261,7 @@ void AppListItemView::OnPaint(gfx::Canvas* canvas) {
bool selected = apps_grid_view_->IsSelectedItem(this);
+ canvas->FillRect(rect, kContentsBackgroundColor);
if (model_->highlighted()) {
canvas->FillRect(rect, kHighlightedColor);
} else if (hover_animation_->is_animating()) {
diff --git a/ui/app_list/search_result_view.cc b/ui/app_list/search_result_view.cc
index 55cc558..f4f3a97 100644
--- a/ui/app_list/search_result_view.cc
+++ b/ui/app_list/search_result_view.cc
@@ -4,6 +4,7 @@
#include "ui/app_list/search_result_view.h"
+#include "ui/app_list/app_list_constants.h"
#include "ui/app_list/search_result.h"
#include "ui/app_list/search_result_list_view.h"
#include "ui/gfx/canvas.h"
@@ -38,7 +39,6 @@ const SkColor kDefaultTextColor = SkColorSetRGB(0x33, 0x33, 0x33);
const SkColor kDimmedTextColor = SkColorSetRGB(0x96, 0x96, 0x96);
const SkColor kURLTextColor = SkColorSetRGB(0x00, 0x99, 0x33);
-const SkColor kBackgroundColor = SkColorSetRGB(0xF5, 0xF5, 0xF5);
const SkColor kSelectedBorderColor = kBorderColor;
const SkColor kSelectedBackgroundColor = SkColorSetARGB(0x0F, 0x4D, 0x90, 0xFE);
const SkColor kHoverAndPushedColor = SkColorSetARGB(0x05, 0, 0, 0);
@@ -190,7 +190,7 @@ void SearchResultView::OnPaint(gfx::Canvas* canvas) {
gfx::Rect content_rect(rect);
content_rect.set_height(rect.height() - kBorderSize);
- canvas->FillRect(content_rect, kBackgroundColor);
+ canvas->FillRect(content_rect, kContentsBackgroundColor);
bool selected = list_view_->IsResultViewSelected(this);
if (selected) {