| Index: ui/views/controls/scrollbar/overlay_scroll_bar.cc
|
| diff --git a/ui/views/controls/scrollbar/overlay_scroll_bar.cc b/ui/views/controls/scrollbar/overlay_scroll_bar.cc
|
| index a3403610edff8a1335f5a3fa96baebb0a871a211..358a0974db2940ff8de695f90d7486fdc5d0e417 100644
|
| --- a/ui/views/controls/scrollbar/overlay_scroll_bar.cc
|
| +++ b/ui/views/controls/scrollbar/overlay_scroll_bar.cc
|
| @@ -136,8 +136,28 @@ int OverlayScrollBar::GetContentOverlapSize() const {
|
| return kThumbThickness;
|
| }
|
|
|
| +void OverlayScrollBar::Layout() {
|
| + gfx::Rect thumb_bounds = GetTrackBounds();
|
| + BaseScrollBarThumb* thumb = GetThumb();
|
| + 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 OverlayScrollBar::CanAcceptEvent(const ui::Event& event) {
|
| + return layer()->opacity() > 0 && BaseScrollBar::CanAcceptEvent(event);
|
| +}
|
| +
|
| void OverlayScrollBar::OnMouseEntered(const ui::MouseEvent& event) {
|
| - Show();
|
| + // Note that events are only accepted when the scrollbar is already visible
|
| + // (due to a change in the scroll value). Don't let the scrollbar vanish from
|
| + // under the mouse pointer.
|
| + hide_timer_.Stop();
|
| }
|
|
|
| void OverlayScrollBar::OnMouseExited(const ui::MouseEvent& event) {
|
| @@ -163,17 +183,4 @@ void OverlayScrollBar::StartHideCountdown() {
|
| base::Bind(&OverlayScrollBar::Hide, base::Unretained(this)));
|
| }
|
|
|
| -void OverlayScrollBar::Layout() {
|
| - gfx::Rect thumb_bounds = GetTrackBounds();
|
| - BaseScrollBarThumb* thumb = GetThumb();
|
| - 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);
|
| -}
|
| -
|
| } // namespace views
|
|
|