diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-03 22:51:52 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-03 22:51:52 +0000 |
commit | 32e851ac4653283d8602cdf20ac1c689416389c8 (patch) | |
tree | f2a332366a9f8b2965b0d70c0a4127aa1293c485 /views/controls/scrollbar | |
parent | d48fd7b8104831e3c5481ca1269f40a9b22271ae (diff) | |
download | chromium_src-32e851ac4653283d8602cdf20ac1c689416389c8.zip chromium_src-32e851ac4653283d8602cdf20ac1c689416389c8.tar.gz chromium_src-32e851ac4653283d8602cdf20ac1c689416389c8.tar.bz2 |
Checking in patch for Denis Romanov (originally reviewed here: http://codereview.chromium.org/651027).
Make mouse wheel scroll contents of views::ScrollView control in Linux (GTK).
BUG=26970
TEST=Make and run out/Debug/view_examples and scroll in ScrollView tab.
TBR=denisromanov
Review URL: http://codereview.chromium.org/667008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/scrollbar')
-rw-r--r-- | views/controls/scrollbar/native_scroll_bar_gtk.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/views/controls/scrollbar/native_scroll_bar_gtk.cc b/views/controls/scrollbar/native_scroll_bar_gtk.cc index 30d714a..c5d75c8 100644 --- a/views/controls/scrollbar/native_scroll_bar_gtk.cc +++ b/views/controls/scrollbar/native_scroll_bar_gtk.cc @@ -80,7 +80,7 @@ bool NativeScrollBarGtk::OnKeyPressed(const KeyEvent& event) { } bool NativeScrollBarGtk::OnMouseWheel(const MouseWheelEvent& e) { - if (!native_view() || native_scroll_bar_->IsHorizontal()) + if (!native_view()) return false; MoveBy(e.GetOffset()); return true; @@ -180,6 +180,10 @@ void NativeScrollBarGtk::MoveStep(bool positive) { } void NativeScrollBarGtk::MoveTo(int p) { + if (p < native_scroll_bar_->GetMinPosition()) + p = native_scroll_bar_->GetMinPosition(); + if (p > native_scroll_bar_->GetMaxPosition()) + p = native_scroll_bar_->GetMaxPosition(); GtkAdjustment* adj = gtk_range_get_adjustment(GTK_RANGE(native_view())); gtk_adjustment_set_value(adj, p); } |