summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-17 12:20:01 +0000
committerxians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-17 12:20:01 +0000
commit8d68f288ad832d91bad4caf4de6ca78ffe6dd06a (patch)
tree0e13c2cc890d0189fbf25d78f52e699316b11784
parentd69a015cad61b30751d17d61f4e80a8278228858 (diff)
downloadchromium_src-8d68f288ad832d91bad4caf4de6ca78ffe6dd06a.zip
chromium_src-8d68f288ad832d91bad4caf4de6ca78ffe6dd06a.tar.gz
chromium_src-8d68f288ad832d91bad4caf4de6ca78ffe6dd06a.tar.bz2
Revert 200695 "Adjust bounds of launcher icons to prevent occlus..."
> Adjust bounds of launcher icons to prevent occlusion of highlights > > This CL changes the layout behaviour of the buttons on the launcher, so that the > highlights on the edge of the launcher are not occluded by the icons as the > launcher is slid in and out. > > BUG=chromium:150772 > TEST=Slowly dragged the shelf down so I could see that icon slid behind the highlight. > > Review URL: https://chromiumcodereview.appspot.com/14924004 TBR=rharrison@chromium.org Review URL: https://codereview.chromium.org/15299003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200792 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/launcher/launcher_button.cc39
1 files changed, 9 insertions, 30 deletions
diff --git a/ash/launcher/launcher_button.cc b/ash/launcher/launcher_button.cc
index 902f79c..1acee58 100644
--- a/ash/launcher/launcher_button.cc
+++ b/ash/launcher/launcher_button.cc
@@ -7,9 +7,7 @@
#include <algorithm>
#include "ash/launcher/launcher_button_host.h"
-#include "ash/screen_ash.h"
#include "ash/shelf/shelf_layout_manager.h"
-#include "ash/shell.h"
#include "grit/ash_resources.h"
#include "skia/ext/image_operations.h"
#include "ui/base/accessibility/accessible_view_state.h"
@@ -393,46 +391,29 @@ void LauncherButton::GetAccessibleState(ui::AccessibleViewState* state) {
}
void LauncherButton::Layout() {
- gfx::Rect launcher_bounds(GetContentsBounds());
- gfx::Rect icon_bounds;
- if (shelf_layout_manager_->IsHorizontalAlignment()) {
+ const gfx::Rect button_bounds(GetContentsBounds());
+ int x_offset = 0, y_offset = 0;
+ gfx::Rect icon_bounds;
+ if (shelf_layout_manager_->IsHorizontalAlignment()) {
icon_bounds.SetRect(
- launcher_bounds.x(), launcher_bounds.y() + kIconPad,
- launcher_bounds.width(), kIconSize);
+ button_bounds.x(), button_bounds.y() + kIconPad,
+ button_bounds.width(), kIconSize);
} else {
icon_bounds.SetRect(
- launcher_bounds.x() + kIconPad, launcher_bounds.y(),
- kIconSize, launcher_bounds.height());
+ button_bounds.x() + kIconPad, button_bounds.y(),
+ kIconSize, button_bounds.height());
}
- int x_offset = 0;
- int y_offset = 0;
if (ShouldHop(state_)) {
x_offset += shelf_layout_manager_->SelectValueForShelfAlignment(
0, kHopSpacing, -kHopSpacing, 0);
y_offset += shelf_layout_manager_->SelectValueForShelfAlignment(
-kHopSpacing, 0, 0, kHopSpacing);
}
- icon_bounds.Offset(x_offset, y_offset);
-
- views::Widget* widget = GetWidget();
- if (widget) {
- gfx::Rect edge_bounds =
- Shell::GetScreen()->GetDisplayNearestWindow(
- widget->GetNativeView()).bounds();
- edge_bounds.Inset(shelf_layout_manager_->SelectValueForShelfAlignment(
- gfx::Insets(0, 0, kBarSize, 0),
- gfx::Insets(0, kBarSize, 0, 0),
- gfx::Insets(0, 0, 0, kBarSize),
- gfx::Insets(kBarSize, 0, 0, 0)));
- edge_bounds = ScreenAsh::ConvertRectFromScreen(widget->GetNativeView(),
- edge_bounds);
- icon_bounds.Intersect(edge_bounds);
- }
+ icon_bounds.Offset(x_offset, y_offset);
icon_view_->SetBoundsRect(icon_bounds);
bar_->SetBarBoundsRect(GetContentsBounds());
-
UpdateState();
}
@@ -544,7 +525,5 @@ void LauncherButton::UpdateState() {
SchedulePaint();
}
-
-
} // namespace internal
} // namespace ash