Replace Window::scrolling_scrollbar with Window::mouse_capture_widget #7227
Conversation
No issues, with the exception of the active_widget rename |
…ispatch OnClick() event if widget is not a scrollbar. This allows any widget to support mouse capture.
This makes the slider continue to respond even when mouse cursor is no longer over the widget.
This allows the mini-map to be dragged when the cursor has left the widget.
Variable has been renamed :-) |
PeterN
added a commit
to PeterN/OpenTTD
that referenced
this pull request
Feb 21, 2019
LordAro
added a commit
that referenced
this pull request
Feb 22, 2019
nielsmh
added a commit
to nielsmh/OpenTTD
that referenced
this pull request
Mar 11, 2019
douiwby
added a commit
to douiwby/OpenTTD
that referenced
this pull request
Apr 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
This allows us to support generic widget scrolling/dragging. Scrollbars are now handled by testing that the widget type is
NWID_VSCROLLBAR
orNWID_HSCROLLBAR
, otherwise anOnClick()
event is dispatched to the window withclick_count
of zero (logically no additional clicks have been made).This is followed up by setting
mouse_capture_widget
when dragging a music window volume slider, see #7209 for reference.And for completeness, click-left dragging the smallmap is improved (and matches right-click dragging behaviour) by setting
mouse_capture_widget
.