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

Side by Side Diff: ash/system/status_area_widget_delegate.cc

Issue 2103113003: Fix shelf layout when switching from left-aligned shelf to right-aligned shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated approach Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/system/status_area_widget_delegate.h" 5 #include "ash/system/status_area_widget_delegate.h"
6 6
7 #include "ash/ash_export.h" 7 #include "ash/ash_export.h"
8 #include "ash/common/ash_switches.h" 8 #include "ash/common/ash_switches.h"
9 #include "ash/common/focus_cycler.h" 9 #include "ash/common/focus_cycler.h"
10 #include "ash/common/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 } else { // SHELF_ALIGNMENT_RIGHT 219 } else { // SHELF_ALIGNMENT_RIGHT
220 top_edge = 0; 220 top_edge = 0;
221 left_edge = kShelfItemInset; 221 left_edge = kShelfItemInset;
222 bottom_edge = 222 bottom_edge =
223 on_edge ? GetTrayConstant(TRAY_PADDING_FROM_EDGE_OF_SHELF) : 0; 223 on_edge ? GetTrayConstant(TRAY_PADDING_FROM_EDGE_OF_SHELF) : 0;
224 right_edge = shelf_size - kShelfItemInset - item_height; 224 right_edge = shelf_size - kShelfItemInset - item_height;
225 } 225 }
226 } 226 }
227 child->SetBorder(views::Border::CreateEmptyBorder(top_edge, left_edge, 227 child->SetBorder(views::Border::CreateEmptyBorder(top_edge, left_edge,
228 bottom_edge, right_edge)); 228 bottom_edge, right_edge));
229 // Force layout to update after change border around |child|.
James Cook 2016/06/29 22:20:35 nit: I would explain in a little more detail *why*
230 child->InvalidateLayout();
229 } 231 }
230 232
231 } // namespace ash 233 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698