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

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

Issue 136303008: Implement ui for re-parenting an item from an app list folder to another position or folder in the … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 6 years, 10 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
« no previous file with comments | « ui/app_list/views/app_list_item_view.h ('k') | ui/app_list/views/apps_container_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 54eda7d62cb146bd2b46de6d5d2f45d6a2173db7..941b55acb01506e2f783c1e68af028450e83d6c8 100644
--- a/ui/app_list/views/app_list_item_view.cc
+++ b/ui/app_list/views/app_list_item_view.cc
@@ -266,9 +266,7 @@ void AppListItemView::Layout() {
rect.Inset(left_right_padding, kTopPadding, left_right_padding, 0);
const int y = rect.y();
- gfx::Rect icon_bounds(rect.x(), y, rect.width(), icon_size_.height());
- icon_bounds.Inset(gfx::ShadowValue::GetMargin(icon_shadows_));
- icon_->SetBoundsRect(icon_bounds);
+ icon_->SetBoundsRect(GetIconBoundsForTargetViewBounds(GetContentsBounds()));
const gfx::Size title_size = title_->GetPreferredSize();
gfx::Rect title_bounds(rect.x() + (rect.width() - title_size.width()) / 2,
y + icon_size_.height() + kIconTitleSpacing,
@@ -466,4 +464,21 @@ const gfx::Rect& AppListItemView::GetIconBounds() const {
return icon_->bounds();
}
+void AppListItemView::SetDragUIState() {
+ SetUIState(UI_STATE_DRAGGING);
+}
+
+gfx::Rect AppListItemView::GetIconBoundsForTargetViewBounds(
+ const gfx::Rect& target_bounds) {
+ gfx::Rect rect(target_bounds);
+
+ const int left_right_padding =
+ title_->font_list().GetExpectedTextWidth(kLeftRightPaddingChars);
+ rect.Inset(left_right_padding, kTopPadding, left_right_padding, 0);
+
+ gfx::Rect icon_bounds(rect.x(), rect.y(), rect.width(), icon_size_.height());
+ icon_bounds.Inset(gfx::ShadowValue::GetMargin(icon_shadows_));
+ return icon_bounds;
+}
+
} // namespace app_list
« no previous file with comments | « ui/app_list/views/app_list_item_view.h ('k') | ui/app_list/views/apps_container_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698