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

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: address comments & Refactor border around item implementation 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
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"
tdanderson 2016/06/05 21:57:07 nit: the corresponding .h should always be first i
yiyix 2016/06/10 19:26:04 Done.
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 const int kShelfItemInset = 3;
16
17 int GetShelfLayoutConstant(ShelfLayoutConstant constant) {
18 const int kShelfSize[] = {47, 48};
19 const int kShelfButtonSpacing[] = {10, 16};
20 const int kShelfButtonSize[] = {44, 48};
21
22 int mode = MaterialDesignController::IsShelfMaterial()
23 ? MaterialDesignController::Mode::MATERIAL_NORMAL
24 : MaterialDesignController::Mode::NON_MATERIAL;
25
26 switch (constant) {
27 case SHELF_SIZE:
28 return kShelfSize[mode];
29 case SHELF_BUTTON_SPACING:
30 return kShelfButtonSpacing[mode];
31 case SHELF_BUTTON_SIZE:
32 return kShelfButtonSize[mode];
33 }
34 NOTREACHED();
35 return 0;
36 }
13 37
14 } // namespace ash 38 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698