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

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: 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..97194a9066e42ceb954c6d4dcbac27b4da0d6674 100644
--- a/ui/views/controls/scrollbar/base_scroll_bar.cc
+++ b/ui/views/controls/scrollbar/base_scroll_bar.cc
@@ -128,6 +128,20 @@ void BaseScrollBar::OnThumbStateChanged(CustomButton::ButtonState old_state,
///////////////////////////////////////////////////////////////////////////////
// BaseScrollBar, View implementation:
+void BaseScrollBar::Layout() {
tapted 2016/02/22 04:42:15 If we keep this here, the identical logic can be r
spqchan 2016/02/22 19:01:37 Done.
+ // Provide a default implementation that sets the thumb's bounds in the
+ // scrollbar.
+ gfx::Rect thumb_bounds = GetTrackBounds();
+ 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