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

Side by Side Diff: ash/shelf/shelf_constants.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: Created 4 years, 7 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
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/material_design/material_design_controller.h"
5 #include "ash/shelf/shelf_constants.h" 6 #include "ash/shelf/shelf_constants.h"
7 #include "base/logging.h"
6 8
7 namespace ash { 9 namespace ash {
8 10
9 const int kInvalidImageResourceID = -1; 11 const int kInvalidImageResourceID = -1;
10 const int kShelfSize = 47; 12 const int kWorkspaceAreaVisibleInset = 2;
11 const int kShelfButtonSpacing = 10; 13 const int kWorkspaceAreaAutoHideInset = 5;
12 const int kShelfButtonSize = 44; 14 const int kAutoHideSize = 3;
15
16 int GetShelfLayoutConstant(ShelfLayoutConstant constant) {
17 const int kShelfSize[] = {47, 48};
18 const int kShelfButtonSpacing[] = {10, 16};
19 const int kShelfButtonSize[] = {44, 48};
20
21 int mode = MaterialDesignController::Mode::NON_MATERIAL;
bruthig 2016/05/25 20:24:52 Alternatively replace lines 21-23 using the ternar
yiyix 2016/06/02 03:54:53 Done.
22 if (MaterialDesignController::IsShelfMaterial())
23 mode = MaterialDesignController::Mode::MATERIAL_NORMAL;
24
25 switch (constant) {
26 case SHELF_SIZE:
27 return kShelfSize[mode];
28 case SHELF_BUTTON_SPACING:
29 return kShelfButtonSpacing[mode];
30 case SHELF_BUTTON_SIZE:
31 return kShelfButtonSize[mode];
32 }
33 NOTREACHED();
34 return 0;
35 }
13 36
14 } // namespace ash 37 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698