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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: ash/shelf/shelf_constants.cc
diff --git a/ash/shelf/shelf_constants.cc b/ash/shelf/shelf_constants.cc
index dff9883617d42021b024cc6c7915a8942b077672..640de7957116cf3c09dd3fdf61aa9cd8b47a242e 100644
--- a/ash/shelf/shelf_constants.cc
+++ b/ash/shelf/shelf_constants.cc
@@ -2,13 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "ash/material_design/material_design_controller.h"
#include "ash/shelf/shelf_constants.h"
+#include "base/logging.h"
namespace ash {
const int kInvalidImageResourceID = -1;
-const int kShelfSize = 47;
-const int kShelfButtonSpacing = 10;
-const int kShelfButtonSize = 44;
+const int kWorkspaceAreaVisibleInset = 2;
+const int kWorkspaceAreaAutoHideInset = 5;
+const int kAutoHideSize = 3;
+
+int GetShelfLayoutConstant(ShelfLayoutConstant constant) {
+ const int kShelfSize[] = {47, 48};
+ const int kShelfButtonSpacing[] = {10, 16};
+ const int kShelfButtonSize[] = {44, 48};
+
+ 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.
+ if (MaterialDesignController::IsShelfMaterial())
+ mode = MaterialDesignController::Mode::MATERIAL_NORMAL;
+
+ switch (constant) {
+ case SHELF_SIZE:
+ return kShelfSize[mode];
+ case SHELF_BUTTON_SPACING:
+ return kShelfButtonSpacing[mode];
+ case SHELF_BUTTON_SIZE:
+ return kShelfButtonSize[mode];
+ }
+ NOTREACHED();
+ return 0;
+}
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698