diff --git a/src/widget.cpp b/src/widget.cpp index 033180d241..d5735c3f85 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -105,7 +105,7 @@ static void ScrollbarClickPositioning(Window *w, NWidgetScrollbar *sb, int x, in /* Pressing the upper button? */ SetBit(sb->disp_flags, NDB_SCROLLBAR_UP); if (_scroller_click_timeout <= 1) { - _scroller_click_timeout = 3; + _scroller_click_timeout = SCROLLER_CLICK_DELAY; sb->UpdatePosition(rtl ? 1 : -1); } w->scrolling_scrollbar = sb->index; @@ -114,7 +114,7 @@ static void ScrollbarClickPositioning(Window *w, NWidgetScrollbar *sb, int x, in SetBit(sb->disp_flags, NDB_SCROLLBAR_DOWN); if (_scroller_click_timeout <= 1) { - _scroller_click_timeout = 3; + _scroller_click_timeout = SCROLLER_CLICK_DELAY; sb->UpdatePosition(rtl ? -1 : 1); } w->scrolling_scrollbar = sb->index; diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 900a24a29f..aa893fccd9 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -260,8 +260,11 @@ struct DropdownWindow : Window { if (this->scrolling != 0) { int pos = this->vscroll->GetPosition(); - this->vscroll->UpdatePosition(this->scrolling); - this->scrolling = 0; + if (_scroller_click_timeout <= 1) { + _scroller_click_timeout = SCROLLER_CLICK_DELAY; + this->vscroll->UpdatePosition(this->scrolling); + this->scrolling = 0; + } if (pos != this->vscroll->GetPosition()) { this->SetDirty(); diff --git a/src/window.cpp b/src/window.cpp index f766710111..57bf8df49a 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2398,7 +2398,7 @@ static EventState HandleScrollbarScrolling() if (sb->disp_flags & ND_SCROLLBAR_BTN) { if (_scroller_click_timeout == 1) { - _scroller_click_timeout = 3; + _scroller_click_timeout = SCROLLER_CLICK_DELAY; sb->UpdatePosition(rtl == HasBit(sb->disp_flags, NDB_SCROLLBAR_UP) ? 1 : -1); w->SetDirty(); } diff --git a/src/window_gui.h b/src/window_gui.h index bf8500f0f3..e03912b12d 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -885,6 +885,9 @@ extern Point _cursorpos_drag_start; extern int _scrollbar_start_pos; extern int _scrollbar_size; extern byte _scroller_click_timeout; +enum { + SCROLLER_CLICK_DELAY = 6 ///< Delay in video frames between scrollbar doing scroll, we don't want to get to the bottom of the list in an instant +}; extern bool _scrolling_viewport; extern bool _mouse_hovering;