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

Side by Side Diff: ui/app_list/folder_image_source.cc

Issue 686633003: Improved appearance of app list folders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app-list-factor-folderimagesource
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/app_list/folder_image_source.h" 5 #include "ui/app_list/folder_image_source.h"
6 6
7 #include "ui/app_list/app_list_constants.h" 7 #include "ui/app_list/app_list_constants.h"
8 #include "ui/gfx/canvas.h" 8 #include "ui/gfx/canvas.h"
9 #include "ui/gfx/geometry/point.h" 9 #include "ui/gfx/geometry/point.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 resized.width(), 81 resized.width(),
82 resized.height(), 82 resized.height(),
83 x, 83 x,
84 y, 84 y,
85 resized.width(), 85 resized.width(),
86 resized.height(), 86 resized.height(),
87 true); 87 true);
88 } 88 }
89 89
90 void FolderImageSource::Draw(gfx::Canvas* canvas) { 90 void FolderImageSource::Draw(gfx::Canvas* canvas) {
91 // Draw folder circle. 91 // Draw folder circles.
92 gfx::Point center = gfx::Point(size().width() / 2, size().height() / 2); 92 // Shadow.
calamity 2014/10/28 06:30:17 // Draw circle for folder shadow.
Matt Giuca 2014/10/28 07:55:13 Done.
93 gfx::PointF center(size().width() / 2, size().height() / 2);
93 SkPaint paint; 94 SkPaint paint;
94 paint.setStyle(SkPaint::kFill_Style); 95 paint.setStyle(SkPaint::kFill_Style);
95 paint.setAntiAlias(true); 96 paint.setAntiAlias(true);
97 paint.setColor(kFolderShadowColor);
98 canvas->sk_canvas()->drawCircle(
99 center.x(), center.y(), kFolderShadowRadius, paint);
100 // Bubble.
calamity 2014/10/28 06:30:17 // Draw circle for folder bubble. (Is bubble the
Matt Giuca 2014/10/28 07:55:13 Well it was used before (kFolderBubbleColor) so I
101 center = gfx::PointF(size().width() / 2,
102 size().height() / 2 - kFolderShadowOffsetY);
calamity 2014/10/28 06:30:17 gfx::PointF bubble_center? Then use center.x()/y()
Matt Giuca 2014/10/28 07:55:13 Done.
96 paint.setColor(kFolderBubbleColor); 103 paint.setColor(kFolderBubbleColor);
97 canvas->DrawCircle(center, size().width() / 2, paint); 104 canvas->sk_canvas()->drawCircle(
105 center.x(), center.y(), kFolderBubbleRadius, paint);
98 106
99 if (icons_.size() == 0) 107 if (icons_.size() == 0)
100 return; 108 return;
101 109
102 // Draw top items' icons. 110 // Draw top items' icons.
103 const gfx::Size item_icon_size(ItemIconSize()); 111 const gfx::Size item_icon_size(ItemIconSize());
104 std::vector<gfx::Rect> top_icon_bounds = GetTopIconsBounds(gfx::Rect(size())); 112 std::vector<gfx::Rect> top_icon_bounds = GetTopIconsBounds(gfx::Rect(size()));
105 113
106 for (size_t i = 0; i < kNumFolderTopItems && i < icons_.size(); ++i) { 114 for (size_t i = 0; i < kNumFolderTopItems && i < icons_.size(); ++i) {
107 DrawIcon(canvas, 115 DrawIcon(canvas,
108 icons_[i], 116 icons_[i],
109 item_icon_size, 117 item_icon_size,
110 top_icon_bounds[i].x(), 118 top_icon_bounds[i].x(),
111 top_icon_bounds[i].y()); 119 top_icon_bounds[i].y());
112 } 120 }
113 } 121 }
114 122
115 } // namespace app_list 123 } // namespace app_list
OLDNEW
« ui/app_list/app_list_constants.cc ('K') | « ui/app_list/app_list_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698