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

Side by Side Diff: ash/common/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 from @tdanderson 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/common/shelf/shelf_constants.h" 5 #include "ash/common/shelf/shelf_constants.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace ash { 10 namespace ash {
11 11
12 const int kInvalidImageResourceID = -1; 12 const int kInvalidImageResourceID = -1;
13 const int kShelfSize = 47;
14 const int kShelfButtonSpacing = 10;
15 const int kShelfButtonSize = 44;
16 const int kTimeToSwitchBackgroundMs = 1000; 13 const int kTimeToSwitchBackgroundMs = 1000;
14 const int kWorkspaceAreaVisibleInset = 2;
15 const int kWorkspaceAreaAutoHideInset = 5;
16 const int kShelfAutoHideSize = 3;
17 const int kShelfItemInset = 3;
17 const SkColor kShelfBaseColor = SK_ColorBLACK; 18 const SkColor kShelfBaseColor = SK_ColorBLACK;
18 const SkColor kShelfIconColor = SK_ColorWHITE; 19 const SkColor kShelfIconColor = SK_ColorWHITE;
19 20
20 int GetShelfConstant(ShelfConstant shelf_constant) { 21 int GetShelfConstant(ShelfConstant shelf_constant) {
21 const int kShelfBackgroundAlpha[] = {204, 153, 153}; 22 const int kShelfBackgroundAlpha[] = {204, 153, 153};
23 const int kShelfSize[] = {47, 48, 48};
24 const int kShelfButtonSpacing[] = {10, 16, 16};
25 const int kShelfButtonSize[] = {44, 48, 48};
22 26
23 const int mode = MaterialDesignController::GetMode(); 27 const int mode = MaterialDesignController::GetMode();
24 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && 28 DCHECK(mode >= MaterialDesignController::NON_MATERIAL &&
25 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); 29 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL);
26 30
27 switch (shelf_constant) { 31 switch (shelf_constant) {
28 case SHELF_BACKGROUND_ALPHA: 32 case SHELF_BACKGROUND_ALPHA:
29 return kShelfBackgroundAlpha[mode]; 33 return kShelfBackgroundAlpha[mode];
34 case SHELF_SIZE:
35 return kShelfSize[mode];
36 case SHELF_BUTTON_SPACING:
37 return kShelfButtonSpacing[mode];
38 case SHELF_BUTTON_SIZE:
39 return kShelfButtonSize[mode];
30 } 40 }
31 NOTREACHED(); 41 NOTREACHED();
32 return 0; 42 return 0;
33 } 43 }
34 44
35 } // namespace ash 45 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698