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

Side by Side Diff: ash/shelf/overflow_bubble_view.cc

Issue 1998933002: Update shelf spacing in Chrome OS according to the MD specs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 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 unified diff | Download patch
« no previous file with comments | « ash/shelf/app_list_button.cc ('k') | ash/shelf/overflow_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/shelf/overflow_bubble_view.h" 5 #include "ash/shelf/overflow_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 173
174 gfx::Rect OverflowBubbleView::GetBubbleBounds() { 174 gfx::Rect OverflowBubbleView::GetBubbleBounds() {
175 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); 175 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border();
176 gfx::Insets bubble_insets = border->GetInsets(); 176 gfx::Insets bubble_insets = border->GetInsets();
177 177
178 const int border_size = 178 const int border_size =
179 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ? 179 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ?
180 bubble_insets.left() : bubble_insets.top(); 180 bubble_insets.left() : bubble_insets.top();
181 const int arrow_offset = border_size + kPadding + kShelfViewLeadingInset + 181 const int arrow_offset = border_size + kPadding + kShelfViewLeadingInset +
182 kShelfSize / 2; 182 GetShelfConstant(SHELF_SIZE) / 2;
183 183
184 const gfx::Size content_size = GetPreferredSize(); 184 const gfx::Size content_size = GetPreferredSize();
185 border->set_arrow_offset(arrow_offset); 185 border->set_arrow_offset(arrow_offset);
186 186
187 const gfx::Rect anchor_rect = GetAnchorRect(); 187 const gfx::Rect anchor_rect = GetAnchorRect();
188 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds( 188 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds(
189 anchor_rect, 189 anchor_rect,
190 content_size, 190 content_size,
191 false); 191 false);
192 192
(...skipping 19 matching lines...) Expand all
212 212
213 bubble_rect.Offset(0, offset); 213 bubble_rect.Offset(0, offset);
214 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); 214 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y());
215 } 215 }
216 216
217 GetBubbleFrameView()->SchedulePaint(); 217 GetBubbleFrameView()->SchedulePaint();
218 return bubble_rect; 218 return bubble_rect;
219 } 219 }
220 220
221 } // namespace ash 221 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/app_list_button.cc ('k') | ash/shelf/overflow_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698