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

Unified Diff: ash/system/tray/tray_popup_utils.cc

Issue 2831023003: Refactor AddScrollListItem() in system menu detailed views (Closed)
Patch Set: Rebased Created 3 years, 8 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/system/tray/tray_popup_utils.cc
diff --git a/ash/system/tray/tray_popup_utils.cc b/ash/system/tray/tray_popup_utils.cc
index 39d32000d0bb4b4e99fea3986167daa68c5e87c7..41b5fa5d6bc3e3d6f12d8ce76cc9d23e3fc65091 100644
--- a/ash/system/tray/tray_popup_utils.cc
+++ b/ash/system/tray/tray_popup_utils.cc
@@ -49,8 +49,8 @@ namespace {
// stretched horizontally and centered vertically.
std::unique_ptr<views::LayoutManager> CreateDefaultCenterLayoutManager() {
// TODO(bruthig): Use constants instead of magic numbers.
- auto box_layout =
- base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical, 4, 8, 0);
+ auto box_layout = base::MakeUnique<views::BoxLayout>(
+ views::BoxLayout::kVertical, kTrayPopupLabelHorizontalPadding, 8, 0);
box_layout->set_main_axis_alignment(
views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
box_layout->set_cross_axis_alignment(
@@ -175,13 +175,14 @@ TriView* TrayPopupUtils::CreateDefaultRowView() {
return tri_view;
}
-TriView* TrayPopupUtils::CreateSubHeaderRowView() {
- TriView* tri_view = CreateMultiTargetRowView();
- tri_view->SetInsets(gfx::Insets(0, kTrayPopupPaddingHorizontal, 0, 0));
- tri_view->SetContainerVisible(TriView::Container::START, false);
- tri_view->SetContainerLayout(
- TriView::Container::END,
- CreateDefaultLayoutManager(TriView::Container::END));
+TriView* TrayPopupUtils::CreateSubHeaderRowView(bool start_visible) {
+ TriView* tri_view = CreateDefaultRowView();
+ if (!start_visible) {
+ tri_view->SetInsets(gfx::Insets(
+ 0, kTrayPopupPaddingHorizontal - kTrayPopupLabelHorizontalPadding, 0,
+ 0));
+ tri_view->SetContainerVisible(TriView::Container::START, false);
+ }
return tri_view;
}

Powered by Google App Engine
This is Rietveld 408576698