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

Side by Side Diff: ash/common/system/tray/tray_details_view.cc

Issue 2491713003: Fix sizing of tray details scroll views. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | 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/common/system/tray/tray_details_view.h" 5 #include "ash/common/system/tray/tray_details_view.h"
6 6
7 #include "ash/common/ash_view_ids.h" 7 #include "ash/common/ash_view_ids.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h"
10 #include "ash/common/system/tray/system_tray.h" 10 #include "ash/common/system/tray/system_tray.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 379 }
380 380
381 void TrayDetailsView::Layout() { 381 void TrayDetailsView::Layout() {
382 if (bounds().IsEmpty()) { 382 if (bounds().IsEmpty()) {
383 views::View::Layout(); 383 views::View::Layout();
384 return; 384 return;
385 } 385 }
386 386
387 if (scroller_) { 387 if (scroller_) {
388 if (UseMd()) { 388 if (UseMd()) {
389 gfx::Size scroller_size = scroll_content_->GetPreferredSize(); 389 gfx::Size scroller_size = scroller()->GetPreferredSize();
390 gfx::Size pref_size = GetPreferredSize(); 390 gfx::Size pref_size = GetPreferredSize();
391 scroller()->ClipHeightTo( 391 scroller()->ClipHeightTo(
392 0, scroller_size.height() - (pref_size.height() - height())); 392 0, scroller_size.height() - (pref_size.height() - height()));
393 } else { 393 } else {
394 scroller_->set_fixed_size(gfx::Size()); 394 scroller_->set_fixed_size(gfx::Size());
395 gfx::Size size = GetPreferredSize(); 395 gfx::Size size = GetPreferredSize();
396 396
397 // Set the scroller to fill the space above the bottom row, so that the 397 // Set the scroller to fill the space above the bottom row, so that the
398 // bottom row of the detailed view will always stay just above the title 398 // bottom row of the detailed view will always stay just above the title
399 // row. 399 // row.
(...skipping 20 matching lines...) Expand all
420 if (index < child_count() - 1 && child_at(index + 1) != title_row_) 420 if (index < child_count() - 1 && child_at(index + 1) != title_row_)
421 scroll_border_->set_visible(true); 421 scroll_border_->set_visible(true);
422 else 422 else
423 scroll_border_->set_visible(false); 423 scroll_border_->set_visible(false);
424 } 424 }
425 425
426 views::View::OnPaintBorder(canvas); 426 views::View::OnPaintBorder(canvas);
427 } 427 }
428 428
429 } // namespace ash 429 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698