-
-
Notifications
You must be signed in to change notification settings - Fork 947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Window::scrolling_scrollbar with Window::mouse_capture_widget #7227
Merged
+58
−47
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
glx22
reviewed
Feb 14, 2019
3ee8300
to
d5abf53
Compare
nielsmh
reviewed
Feb 17, 2019
LordAro
previously approved these changes
Feb 20, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
d5abf53
to
ae43e96
Compare
Variable has been renamed :-) |
LordAro
approved these changes
Feb 21, 2019
PeterN
added a commit
to PeterN/OpenTTD
that referenced
this pull request
Feb 21, 2019
LordAro
pushed a commit
that referenced
this pull request
Feb 22, 2019
nielsmh
pushed a commit
to nielsmh/OpenTTD
that referenced
this pull request
Mar 11, 2019
douiwby
pushed 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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.