summaryrefslogtreecommitdiffstats
path: root/ash/launcher/launcher_view.cc
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-11 17:47:36 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-11 17:47:36 +0000
commit407ffd38709107fe97e9f82737cb67a2d33a4c78 (patch)
tree29e0ef3e3d7924f26c4cf583a4836c53b24cc8de /ash/launcher/launcher_view.cc
parent8834642d6c6595f29ca9571e201b9937145e6b94 (diff)
downloadchromium_src-407ffd38709107fe97e9f82737cb67a2d33a4c78.zip
chromium_src-407ffd38709107fe97e9f82737cb67a2d33a4c78.tar.gz
chromium_src-407ffd38709107fe97e9f82737cb67a2d33a4c78.tar.bz2
ash: Make some height adjustments for the items in the shelf during dragging.
The change in this patch makes the LauncherViews as high as the launcher itself, and the LauncherButton/AppListButton displays the highlight bar at the bottom, and positions the icon vertically in the center. Also, reduce the max-height of the dragged shelf. BUG=147317 Review URL: https://chromiumcodereview.appspot.com/10928100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher/launcher_view.cc')
-rw-r--r--ash/launcher/launcher_view.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc
index 17eb877..7777978 100644
--- a/ash/launcher/launcher_view.cc
+++ b/ash/launcher/launcher_view.cc
@@ -387,10 +387,11 @@ void LauncherView::CalculateIdealBounds(IdealBounds* bounds) {
continue;
}
- view_model_->set_ideal_bounds(i, gfx::Rect(
- x, y, kLauncherPreferredSize, kLauncherPreferredSize));
- x = primary_axis_coordinate(x + kLauncherPreferredSize + kButtonSpacing, 0);
- y = primary_axis_coordinate(0, y + kLauncherPreferredSize + kButtonSpacing);
+ int w = primary_axis_coordinate(kLauncherPreferredSize, width());
+ int h = primary_axis_coordinate(height(), kLauncherPreferredSize);
+ view_model_->set_ideal_bounds(i, gfx::Rect(x, y, w, h));
+ x = primary_axis_coordinate(x + w + kButtonSpacing, 0);
+ y = primary_axis_coordinate(0, y + h + kButtonSpacing);
}
int app_list_index = view_model_->view_size() - 1;
@@ -407,13 +408,14 @@ void LauncherView::CalculateIdealBounds(IdealBounds* bounds) {
// Makes the first launcher button include the leading inset.
view_model_->set_ideal_bounds(0, gfx::Rect(gfx::Size(
primary_axis_coordinate(leading_inset() + kLauncherPreferredSize,
- kLauncherPreferredSize),
- primary_axis_coordinate(kLauncherPreferredSize,
+ width()),
+ primary_axis_coordinate(height(),
leading_inset() + kLauncherPreferredSize))));
}
- bounds->overflow_bounds.set_size(
- gfx::Size(kLauncherPreferredSize, kLauncherPreferredSize));
+ bounds->overflow_bounds.set_size(gfx::Size(
+ primary_axis_coordinate(kLauncherPreferredSize, width()),
+ primary_axis_coordinate(height(), kLauncherPreferredSize)));
last_visible_index_ = DetermineLastVisibleIndex(
available_size - leading_inset() - kLauncherPreferredSize -
kButtonSpacing - kLauncherPreferredSize);