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

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

Issue 2500493004: [ash-md] Fixes clipping of controls in system tray (Closed)
Patch Set: [ash-md] Fixes clipping of controls in system tray (docs) 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 back_button_ = title_row_->AddBackButton(this); 315 back_button_ = title_row_->AddBackButton(this);
316 316
317 Layout(); 317 Layout();
318 } 318 }
319 319
320 void TrayDetailsView::CreateScrollableList() { 320 void TrayDetailsView::CreateScrollableList() {
321 DCHECK(!scroller_); 321 DCHECK(!scroller_);
322 scroll_content_ = new ScrollContentsView(); 322 scroll_content_ = new ScrollContentsView();
323 scroller_ = new FixedSizedScrollView; 323 scroller_ = new FixedSizedScrollView;
324 scroller_->SetContentsView(scroll_content_); 324 scroller_->SetContentsView(scroll_content_);
325 // Make the |scroller_| have a layer to clip |scroll_content_|'s children.
326 // TODO(varkha): Make the sticky rows work with EnableViewPortLayer().
327 scroller_->SetPaintToLayer(true);
328 scroller_->set_background(
329 views::Background::CreateSolidBackground(kBackgroundColor));
330 scroller_->layer()->SetMasksToBounds(true);
325 331
326 // Note: |scroller_| takes ownership of |scroll_border_|. 332 // Note: |scroller_| takes ownership of |scroll_border_|.
327 if (!UseMd()) { 333 if (!UseMd()) {
328 // In MD, the scroller is always the last thing, so this border is 334 // In MD, the scroller is always the last thing, so this border is
329 // unnecessary and reserves extra space we don't want. 335 // unnecessary and reserves extra space we don't want.
330 scroll_border_ = new ScrollBorder; 336 scroll_border_ = new ScrollBorder;
331 scroller_->SetBorder(std::unique_ptr<views::Border>(scroll_border_)); 337 scroller_->SetBorder(std::unique_ptr<views::Border>(scroll_border_));
332 } 338 }
333 339
334 AddChildView(scroller_); 340 AddChildView(scroller_);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (index < child_count() - 1 && child_at(index + 1) != title_row_) 451 if (index < child_count() - 1 && child_at(index + 1) != title_row_)
446 scroll_border_->set_visible(true); 452 scroll_border_->set_visible(true);
447 else 453 else
448 scroll_border_->set_visible(false); 454 scroll_border_->set_visible(false);
449 } 455 }
450 456
451 views::View::OnPaintBorder(canvas); 457 views::View::OnPaintBorder(canvas);
452 } 458 }
453 459
454 } // namespace ash 460 } // 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