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

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: address comments Created 4 years, 4 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..38bfd8edcf7738e0b9058a38e10fa1e9aba6aaa5 100644
--- a/ash/common/system/overview/overview_button_tray.cc
+++ b/ash/common/system/overview/overview_button_tray.cc
@@ -33,6 +33,10 @@ const int kHorizontalShelfVerticalPadding = 4;
const int kVerticalShelfHorizontalPadding = 2;
const int kVerticalShelfVerticalPadding = 5;
+// Padding used to adjust the user-visible size of overview tray's dark
+// background.
+const int kBackgroundTrayPadding = 3;
+
} // namespace
namespace ash {
@@ -40,6 +44,7 @@ namespace ash {
OverviewButtonTray::OverviewButtonTray(WmShelf* wm_shelf)
: TrayBackgroundView(wm_shelf), icon_(nullptr) {
SetContentsBackground();
+ SetOverviewTrayBorder();
icon_ = new views::ImageView();
if (MaterialDesignController::IsShelfMaterial()) {
@@ -110,7 +115,10 @@ void OverviewButtonTray::SetShelfAlignment(ShelfAlignment alignment) {
return;
TrayBackgroundView::SetShelfAlignment(alignment);
- SetIconBorderForShelfAlignment();
+ if (!ash::MaterialDesignController::IsShelfMaterial()) {
+ SetOverviewTrayBorder();
+ SetIconBorderForShelfAlignment();
+ }
}
void OverviewButtonTray::SetIconBorderForShelfAlignment() {
@@ -123,17 +131,22 @@ void OverviewButtonTray::SetIconBorderForShelfAlignment() {
gfx::Insets(vertical_padding, horizontal_padding)));
} else {
if (IsHorizontalAlignment(shelf_alignment())) {
- icon_->SetBorder(views::Border::CreateEmptyBorder(
- kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding,
- kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding));
+ icon_->SetBorder(views::Border::CreateEmptyBorder(gfx::Insets(
+ kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding)));
} else {
- icon_->SetBorder(views::Border::CreateEmptyBorder(
- kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding,
- kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding));
+ icon_->SetBorder(views::Border::CreateEmptyBorder(gfx::Insets(
+ kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding)));
}
}
}
+void OverviewButtonTray::SetOverviewTrayBorder() {
+ if (!ash::MaterialDesignController::IsShelfMaterial()) {
+ tray_container()->SetBorder(
+ views::Border::CreateEmptyBorder(gfx::Insets(kBackgroundTrayPadding)));
+ }
+}
+
void OverviewButtonTray::UpdateIconVisibility() {
// The visibility of the OverviewButtonTray has diverge from
// WindowSelectorController::CanSelect. The visibility of the button should
@@ -142,7 +155,6 @@ void OverviewButtonTray::UpdateIconVisibility() {
WmShell* shell = WmShell::Get();
SessionStateDelegate* session_state_delegate =
shell->GetSessionStateDelegate();
-
SetVisible(
shell->maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled() &&
session_state_delegate->IsActiveUserSessionStarted() &&

Powered by Google App Engine
This is Rietveld 408576698