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

Unified Diff: ash/common/system/overview/overview_button_tray.cc

Issue 2147143002: [Chrome OS MD] Draw a 1px separator between 2 tray items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 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 side-by-side diff with in-line comments
Download patch
Index: ash/common/system/overview/overview_button_tray.cc
diff --git a/ash/common/system/overview/overview_button_tray.cc b/ash/common/system/overview/overview_button_tray.cc
index e3508b474c4a26553b89336f0d3ed517b8783ff8..801aaf411c6013998409d6bec2ed2e45f43eed9b 100644
--- a/ash/common/system/overview/overview_button_tray.cc
+++ b/ash/common/system/overview/overview_button_tray.cc
@@ -33,6 +33,9 @@ const int kHorizontalShelfVerticalPadding = 4;
const int kVerticalShelfHorizontalPadding = 2;
const int kVerticalShelfVerticalPadding = 5;
+// Padding used to adjust the user-visible size of overview dark background.
varkha 2016/07/14 21:34:47 nit: s/overview/overview tray
yiyix 2016/07/26 20:27:30 Done.
+const int kBackgroundTrayPadding = 3;
+
} // namespace
namespace ash {
@@ -40,6 +43,7 @@ namespace ash {
OverviewButtonTray::OverviewButtonTray(WmShelf* wm_shelf)
: TrayBackgroundView(wm_shelf), icon_(nullptr) {
SetContentsBackground();
+ AdjustOverviewBackground();
icon_ = new views::ImageView();
if (MaterialDesignController::IsShelfMaterial()) {
@@ -110,6 +114,7 @@ void OverviewButtonTray::SetShelfAlignment(ShelfAlignment alignment) {
return;
TrayBackgroundView::SetShelfAlignment(alignment);
+ AdjustOverviewBackground();
varkha 2016/07/14 21:34:47 Do you need to call those 2 methods that create bo
yiyix 2016/07/26 20:27:30 true, I will add a condition. thanks
SetIconBorderForShelfAlignment();
}
@@ -134,6 +139,14 @@ void OverviewButtonTray::SetIconBorderForShelfAlignment() {
}
}
+void OverviewButtonTray::AdjustOverviewBackground() {
+ if (!ash::MaterialDesignController::IsShelfMaterial()) {
+ tray_container()->SetBorder(views::Border::CreateEmptyBorder(
varkha 2016/07/14 21:34:47 nit: simpler to use gfx::Insets(kBackgroundTrayPad
yiyix 2016/07/26 20:27:30 Done.
+ kBackgroundTrayPadding, kBackgroundTrayPadding, kBackgroundTrayPadding,
+ kBackgroundTrayPadding));
+ }
+}
+
void OverviewButtonTray::UpdateIconVisibility() {
// The visibility of the OverviewButtonTray has diverge from
// WindowSelectorController::CanSelect. The visibility of the button should

Powered by Google App Engine
This is Rietveld 408576698