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

Unified Diff: ui/views/controls/scrollbar/base_scroll_bar.cc

Issue 1671313002: MacViews: Overlay Scrollbars with Show/Hide Animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 10 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: ui/views/controls/scrollbar/base_scroll_bar.cc
diff --git a/ui/views/controls/scrollbar/base_scroll_bar.cc b/ui/views/controls/scrollbar/base_scroll_bar.cc
index 117fe345dffea247bef217e0c73e1210d7ea7b24..24c477499a4b34b8e4c9e00dd60737c3f11703fd 100644
--- a/ui/views/controls/scrollbar/base_scroll_bar.cc
+++ b/ui/views/controls/scrollbar/base_scroll_bar.cc
@@ -128,6 +128,18 @@ void BaseScrollBar::OnThumbStateChanged(CustomButton::ButtonState old_state,
///////////////////////////////////////////////////////////////////////////////
// BaseScrollBar, View implementation:
+void BaseScrollBar::Layout() {
+ gfx::Rect thumb_bounds = GetTrackBounds();
tapted 2016/02/16 23:32:57 Yeah - I'm not sure what views/OWNERS will think a
spqchan 2016/02/17 00:05:29 Done.
+ if (IsHorizontal()) {
+ thumb_bounds.set_x(thumb_->x());
+ thumb_bounds.set_width(thumb_->width());
+ } else {
+ thumb_bounds.set_y(thumb_->y());
+ thumb_bounds.set_height(thumb_->height());
+ }
+ thumb_->SetBoundsRect(thumb_bounds);
+}
+
bool BaseScrollBar::OnMousePressed(const ui::MouseEvent& event) {
if (event.IsOnlyLeftMouseButton())
ProcessPressEvent(event);

Powered by Google App Engine
This is Rietveld 408576698