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

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

Issue 2952823002: cros: Make SearchResultTileItemView layout per DisplayType customized (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
« ui/app_list/views/tile_item_view.h ('K') | « ui/app_list/views/tile_item_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/tile_item_view.cc
diff --git a/ui/app_list/views/tile_item_view.cc b/ui/app_list/views/tile_item_view.cc
index 5e6543b1db78547f906ed50596031e3d17554e69..b1d211409eb0d782f7749232e0b951102591cd1f 100644
--- a/ui/app_list/views/tile_item_view.cc
+++ b/ui/app_list/views/tile_item_view.cc
@@ -21,8 +21,6 @@ constexpr int kTopPadding = 5;
constexpr int kTileSize = 90;
constexpr int kIconTitleSpacing = 6;
-constexpr int kBadgeBackgroundRadius = 10;
-
// The background image source for badge.
class BadgeBackgroundImageSource : public gfx::CanvasImageSource {
public:
@@ -154,21 +152,10 @@ void TileItemView::StateChanged(ButtonState old_state) {
void TileItemView::Layout() {
gfx::Rect rect(GetContentsBounds());
- if (rect.IsEmpty())
- return;
rect.Inset(0, kTopPadding, 0, 0);
icon_->SetBoundsRect(rect);
- if (badge_) {
- gfx::Rect badge_rect(rect);
- gfx::Size icon_size = icon_->GetImage().size();
- badge_rect.Offset(
- (icon_size.width() - kAppBadgeIconSize) / 2,
- icon_size.height() - kBadgeBackgroundRadius - kAppBadgeIconSize / 2);
- badge_->SetBoundsRect(badge_rect);
- }
-
rect.Inset(0, kGridIconDimension + kIconTitleSpacing, 0, 0);
rect.set_height(title_->GetPreferredSize().height());
title_->SetBoundsRect(rect);
@@ -183,6 +170,10 @@ void TileItemView::ImageShadowAnimationProgressed(
icon_->SetImage(animator->shadow_image());
}
+gfx::Size TileItemView::CalculatePreferredSize() const {
+ return gfx::Size(kTileSize, kTileSize);
+}
+
void TileItemView::UpdateBackgroundColor() {
std::unique_ptr<views::Background> background;
SkColor background_color = parent_background_color_;
@@ -209,10 +200,6 @@ void TileItemView::UpdateBackgroundColor() {
SchedulePaint();
}
-gfx::Size TileItemView::CalculatePreferredSize() const {
- return gfx::Size(kTileSize, kTileSize);
-}
-
bool TileItemView::GetTooltipText(const gfx::Point& p,
base::string16* tooltip) const {
// Use the label to generate a tooltip, so that it will consider its text
« ui/app_list/views/tile_item_view.h ('K') | « ui/app_list/views/tile_item_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698