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

Unified Diff: ash/common/system/tray/tray_background_view.cc

Issue 2209443006: Show small notification icons in notification tray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and addressed 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/tray/tray_background_view.cc
diff --git a/ash/common/system/tray/tray_background_view.cc b/ash/common/system/tray/tray_background_view.cc
index 3e26c5069993d2872ef9ae0d0f4602002b223bb3..4ed67b01e4c7c3d7bd0fb0d376148f6c39339852 100644
--- a/ash/common/system/tray/tray_background_view.cc
+++ b/ash/common/system/tray/tray_background_view.cc
@@ -175,6 +175,11 @@ void TrayBackgroundView::TrayContainer::SetAlignment(ShelfAlignment alignment) {
UpdateLayout();
}
+void TrayBackgroundView::TrayContainer::SetMargin(const gfx::Insets& margin) {
+ margin_ = margin;
+ UpdateLayout();
+}
+
gfx::Size TrayBackgroundView::TrayContainer::GetPreferredSize() const {
if (size_.IsEmpty())
return views::View::GetPreferredSize();
@@ -207,8 +212,9 @@ void TrayBackgroundView::TrayContainer::UpdateLayout() {
// Additional padding used to adjust the user-visible size of status tray
// dark background.
const int padding = 3;
- SetBorder(
- views::Border::CreateEmptyBorder(padding, padding, padding, padding));
+ SetBorder(views::Border::CreateEmptyBorder(gfx::Insets(padding) + margin_));
+ } else {
+ SetBorder(views::Border::CreateEmptyBorder(margin_));
}
views::BoxLayout* layout = new views::BoxLayout(orientation, 0, 0, 0);

Powered by Google App Engine
This is Rietveld 408576698