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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 23928004: ash:Shelf - Update position and hit box of status area. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maybe Created 7 years, 3 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 | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 0d94aa48c19d4c4b01aa87d1e49eb4e569163a55..ea88afed0e839bf8c159bcf036899549e89aece0 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -73,9 +73,6 @@ const int kNotificationBubbleGapHeight = 6;
// the auto hidden shelf when the shelf is on the boundary between displays.
const int kMaxAutoHideShowShelfRegionSize = 10;
-// Const inset from the edget of the shelf to the edget of the status area.
-const int kStatusAreaInset = 3;
-
ui::Layer* GetLayer(views::Widget* widget) {
return widget->GetNativeView()->layer();
}
@@ -100,6 +97,9 @@ const int ShelfLayoutManager::kAutoHideSize = 3;
// static
const int ShelfLayoutManager::kShelfSize = 47;
+// static
+const int ShelfLayoutManager::kShelfItemInset = 3;
+
int ShelfLayoutManager::GetPreferredShelfSize() {
return ash::switches::UseAlternateShelfLayout() ?
ShelfLayoutManager::kShelfSize : kLauncherPreferredSize;
@@ -769,8 +769,13 @@ void ShelfLayoutManager::CalculateTargetBounds(
int status_inset = std::max(0, GetPreferredShelfSize() -
PrimaryAxisValue(status_size.height(), status_size.width()));
- if (ash::switches::UseAlternateShelfLayout())
- status_inset = kStatusAreaInset;
+ if (ash::switches::UseAlternateShelfLayout()) {
+ status_inset = 0;
+ if (IsHorizontalAlignment())
+ status_size.set_height(kShelfSize);
+ else
+ status_size.set_width(kShelfSize);
+ }
target_bounds->status_bounds_in_shelf = SelectValueForShelfAlignment(
gfx::Rect(base::i18n::IsRTL() ? 0 : shelf_width - status_size.width(),
@@ -882,7 +887,7 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture(
}
if (ash::switches::UseAlternateShelfLayout()) {
- target_bounds->status_bounds_in_shelf.set_y(kStatusAreaInset);
+ target_bounds->status_bounds_in_shelf.set_y(0);
} else {
// The statusbar should be in the center of the shelf.
gfx::Rect status_y = target_bounds->shelf_bounds_in_root;
@@ -907,12 +912,12 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture(
}
if (ash::switches::UseAlternateShelfLayout()) {
- if (right_aligned) {
- target_bounds->status_bounds_in_shelf.set_x(kStatusAreaInset);
- } else {
+ if (right_aligned)
+ target_bounds->status_bounds_in_shelf.set_x(0);
+ else
target_bounds->status_bounds_in_shelf.set_x(
- available_bounds.right() - shelf_width + kStatusAreaInset);
- }
+ target_bounds->shelf_bounds_in_root.width() -
+ kShelfSize);
} else {
// The statusbar should be in the center of the shelf.
gfx::Rect status_x = target_bounds->shelf_bounds_in_root;
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698