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

Side by Side Diff: ash/system/tray/tray_background_view.cc

Issue 284753002: Add main axis alignment for BoxLayout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove set_spread_blank_space, rename to MainAxisAlignment Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/system/tray/system_tray_bubble.cc ('k') | ash/system/tray_accessibility.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/tray/tray_background_view.h" 5 #include "ash/system/tray/tray_background_view.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/screen_util.h" 9 #include "ash/screen_util.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 if (alignment_ == SHELF_ALIGNMENT_BOTTOM || 269 if (alignment_ == SHELF_ALIGNMENT_BOTTOM ||
270 alignment_ == SHELF_ALIGNMENT_TOP) { 270 alignment_ == SHELF_ALIGNMENT_TOP) {
271 SetBorder(views::Border::CreateEmptyBorder( 271 SetBorder(views::Border::CreateEmptyBorder(
272 kPaddingFromEdgeOfShelf, 272 kPaddingFromEdgeOfShelf,
273 kPaddingFromEdgeOfShelf, 273 kPaddingFromEdgeOfShelf,
274 kPaddingFromEdgeOfShelf, 274 kPaddingFromEdgeOfShelf,
275 kPaddingFromEdgeOfShelf)); 275 kPaddingFromEdgeOfShelf));
276 276
277 views::BoxLayout* layout = 277 views::BoxLayout* layout =
278 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); 278 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
279 layout->set_spread_blank_space(true); 279 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL);
280 views::View::SetLayoutManager(layout); 280 views::View::SetLayoutManager(layout);
281 } else { 281 } else {
282 SetBorder(views::Border::CreateEmptyBorder( 282 SetBorder(views::Border::CreateEmptyBorder(
283 kPaddingFromEdgeOfShelf, 283 kPaddingFromEdgeOfShelf,
284 kPaddingFromEdgeOfShelf, 284 kPaddingFromEdgeOfShelf,
285 kPaddingFromEdgeOfShelf, 285 kPaddingFromEdgeOfShelf,
286 kPaddingFromEdgeOfShelf)); 286 kPaddingFromEdgeOfShelf));
287 287
288 views::BoxLayout* layout = 288 views::BoxLayout* layout =
289 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0); 289 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
290 layout->set_spread_blank_space(true); 290 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL);
291 views::View::SetLayoutManager(layout); 291 views::View::SetLayoutManager(layout);
292 } 292 }
293 PreferredSizeChanged(); 293 PreferredSizeChanged();
294 } 294 }
295 295
296 //////////////////////////////////////////////////////////////////////////////// 296 ////////////////////////////////////////////////////////////////////////////////
297 // TrayBackgroundView 297 // TrayBackgroundView
298 298
299 TrayBackgroundView::TrayBackgroundView(StatusAreaWidget* status_area_widget) 299 TrayBackgroundView::TrayBackgroundView(StatusAreaWidget* status_area_widget)
300 : status_area_widget_(status_area_widget), 300 : status_area_widget_(status_area_widget),
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 background_->set_alpha(kTrayBackgroundAlpha); 596 background_->set_alpha(kTrayBackgroundAlpha);
597 SchedulePaint(); 597 SchedulePaint();
598 } 598 }
599 599
600 void TrayBackgroundView::UpdateBubbleViewArrow( 600 void TrayBackgroundView::UpdateBubbleViewArrow(
601 views::TrayBubbleView* bubble_view) { 601 views::TrayBubbleView* bubble_view) {
602 // Nothing to do here. 602 // Nothing to do here.
603 } 603 }
604 604
605 } // namespace ash 605 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray_bubble.cc ('k') | ash/system/tray_accessibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698