diff options
author | rubidium <rubidium@openttd.org> | 2010-10-15 11:16:14 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-10-15 11:16:14 +0000 |
commit | 951b725b8c001003b38f0b009b6d6df55cb6ec02 (patch) | |
tree | d3aaf64777e56c38ffd16bf93f5224e0b2450a8c /src/window.cpp | |
parent | 4eaf01fcdb5d2aedc2c4484130940bb43b8aec9c (diff) | |
download | openttd-951b725b8c001003b38f0b009b6d6df55cb6ec02.tar.xz |
(svn r20922) -Fix [FS#4071]: accidentally moving the mouse of the scrollbar arrows while pressing it clicks the button next to the arrow
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp index b362ffcc8..6b03e23d5 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1861,6 +1861,15 @@ static EventState HandleScrollbarScrolling() i = _cursor.pos.y - _cursorpos_drag_start.y; } + if (sb->disp_flags & ND_SCROLLBAR_BTN) { + if (_scroller_click_timeout == 1) { + _scroller_click_timeout = 3; + sb->UpdatePosition(rtl == HasBit(sb->disp_flags, NDB_SCROLLBAR_UP) ? 1 : -1); + w->SetDirty(); + } + return ES_HANDLED; + } + /* Find the item we want to move to and make sure it's inside bounds. */ int pos = min(max(0, i + _scrollbar_start_pos) * sb->GetCount() / _scrollbar_size, max(0, sb->GetCount() - sb->GetCapacity())); if (rtl) pos = max(0, sb->GetCount() - sb->GetCapacity() - pos); |