Skip to content
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

Emit slider's drag_started signal before the first value change #86377

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

timothyqiu
Copy link
Member

@timothyqiu timothyqiu commented Dec 21, 2023

Fixes #86370

#80916 made value_changed to emit after drag_started in order to fix ColorPicker's deferred mode. But the actual value change is still before drag_started.

It was then impossible to safely ignore value_changed signal when dragging, because you'll miss the value_changed signal when pressing down the mouse button.

This PR:

  1. Moves drag_started before the initial value change, so users can get the correct start value when handling the signal.
  2. Records the value before the initial value change, so that drag_ended can correctly tell that the value is changed if the user simply clicks somewhere on the slider other than the grabber.

@timothyqiu timothyqiu added this to the 4.3 milestone Dec 21, 2023
@timothyqiu timothyqiu requested review from a team as code owners December 21, 2023 03:36
@YuriSizov YuriSizov merged commit b4fe310 into godotengine:master Dec 22, 2023
15 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@timothyqiu timothyqiu deleted the slider-drag branch December 22, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slider drag_ended signal triggered with click interaction passes false as changed_value
3 participants