godot
godot copied to clipboard
Ensure color picker eyedropper notifies button
color_changed is continuously emitted while moving the picker, unless deferred mode is enabled.
Added a workaround so that color_changed is always emitted when the eyedropper screen object is hidden, since it is not currently able to receive any mouse button events itself.
Fixes #62858
I thought continuously updating the ColorPickerButton while using the eyedropper was fairly consistent with how the color wheel behaves if you hold LMB and move over it. But maybe ideally it should be possible to cancel the color picker with escape, while the ColorPicker popup remains open.
I was not able to fix that the ColorPicker popup closes after clicking with the eyedropper. Not sure if possible to prevent the Popup from closing as soon as it loses focus without larger changes.
@KoBeWi ping since we talked about this on discord
Because the sampling is actually achieved by sampling from the ViewportTexture, and the processing mechanism of gui_input, so it cannot take into account all modes of window.
The ColorPicker refactor was merged, so this needs rebase.
I'll try to have a look at it later this week. Perhaps it's not necessary after the refactoring
The issue is still valid.
It has been rebased. There are currently 2 minor issues that I don't know if they need to be fixed before submitting:
- If one cancels the eyedropper operation by clicking its button again (this seemed like a thing one expects to be able to do, since the popup stays up and sampling is suspended while hovering it. See discussions above)
- The eyedropper button gets a blue frame when clicked, and clicking doesn't remove it. I don't know why, but it seems inconsistent with other buttons in the popup.
It has been rebased. There are currently 2 minor issues that I don't know if they need to be fixed before submitting:
- If one cancels the eyedropper operation by clicking its button again (this seemed like a thing one expects to be able to do, since the popup stays up and sampling is suspended while hovering it. See discussions above)
- The eyedropper button gets a blue frame when clicked, and clicking doesn't remove it. I don't know why, but it seems inconsistent with other buttons in the popup.
Seems like picking is broken in the current master, so this PR can't easily be tested right now.
@KoBeWi what issue did you have with picking? I rebased this PR on master and it looks like it's working. Didn't try without my changes, but I can do that too if you want.
what issue did you have with picking?

@KoBeWi you mean that when you click with the picker it it closes the dialog but doesn't update the Modulate colour in your example? This PR should fix that, or it does for me at least
It does completely nothing. Doesn't even update the button (you can see it's still white). I tested your PR and it doesn't fix this (it's probably not even related, because it wasn't like that before).
Are you using Windows (or Mac)? I'm on Linux so maybe the problem is platform specific
When I activate the picker and hover it updates the colour in the picker popup dialogue continuously, but the value is not copied to the editor button (on master). With my PR the editor button is updated when hovering something.
Seems like picking is broken in the current master, so this PR can't easily be tested right now.
Probably Windows specific, picking is working on macOS.
Would this be superseded by #72764, or is it still relevant independently?
I'll test to see if it's still necessary after that fix.
It is no longer relevant with the new colour picker as far as I can see.
The new solution shows a screenshot from which the user can pick a colour, so the live ColorPicker widget and Godot editor UI is hidden during the entire eye dropper operation, therefore it does not matter if the box is updated in real time.