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

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

Issue 2555213004: Improving the appearance of overlay scrollbars (Closed)
Patch Set: attempt to fix mac Created 4 years 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
« no previous file with comments | « no previous file | ash/common/system/tray/tray_details_view.cc » ('j') | ui/views/controls/scroll_view.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/fixed_sized_scroll_view.cc
diff --git a/ash/common/system/tray/fixed_sized_scroll_view.cc b/ash/common/system/tray/fixed_sized_scroll_view.cc
index e14a6107eea89a8419059d43ebda022105946b30..33fcef69cb9836ae9492eed2c1b4b234998e669b 100644
--- a/ash/common/system/tray/fixed_sized_scroll_view.cc
+++ b/ash/common/system/tray/fixed_sized_scroll_view.cc
@@ -19,8 +19,10 @@ bool UseMd() {
FixedSizedScrollView::FixedSizedScrollView() {
set_notify_enter_exit_on_child(true);
- if (UseMd())
+ if (UseMd()) {
SetVerticalScrollBar(new views::OverlayScrollBar(false));
+ SetHorizontalScrollBar(new views::OverlayScrollBar(true));
+ }
}
FixedSizedScrollView::~FixedSizedScrollView() {}
@@ -60,7 +62,7 @@ void FixedSizedScrollView::Layout() {
return views::ScrollView::Layout();
gfx::Rect bounds = gfx::Rect(contents()->GetPreferredSize());
- bounds.set_width(std::max(0, width() - GetScrollBarWidth()));
+ bounds.set_width(std::max(0, width() - GetScrollBarLayoutWidth()));
// Keep the origin of the contents unchanged so that the list will not scroll
// away from the current visible region user is viewing. ScrollView::Layout()
// will make sure the contents line up with its viewport properly if
@@ -71,7 +73,7 @@ void FixedSizedScrollView::Layout() {
views::ScrollView::Layout();
if (!vertical_scroll_bar()->visible()) {
gfx::Rect bounds = contents()->bounds();
- bounds.set_width(bounds.width() + GetScrollBarWidth());
+ bounds.set_width(bounds.width() + GetScrollBarLayoutWidth());
contents()->SetBoundsRect(bounds);
}
}
@@ -81,7 +83,7 @@ void FixedSizedScrollView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
return;
gfx::Rect bounds = gfx::Rect(contents()->GetPreferredSize());
- bounds.set_width(std::max(0, width() - GetScrollBarWidth()));
+ bounds.set_width(std::max(0, width() - GetScrollBarLayoutWidth()));
contents()->SetBoundsRect(bounds);
}
« no previous file with comments | « no previous file | ash/common/system/tray/tray_details_view.cc » ('j') | ui/views/controls/scroll_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698