godot icon indicating copy to clipboard operation
godot copied to clipboard

Ensure color picker eyedropper notifies button

Open JohanAR opened this issue 3 years ago • 1 comments

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

JohanAR avatar Aug 03 '22 18:08 JohanAR

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

JohanAR avatar Aug 03 '22 19:08 JohanAR

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.

Rindbee avatar Aug 08 '22 05:08 Rindbee

The ColorPicker refactor was merged, so this needs rebase.

KoBeWi avatar Oct 23 '22 14:10 KoBeWi

I'll try to have a look at it later this week. Perhaps it's not necessary after the refactoring

JohanAR avatar Oct 24 '22 06:10 JohanAR

The issue is still valid.

KoBeWi avatar Oct 24 '22 09:10 KoBeWi

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.

JohanAR avatar Nov 03 '22 14:11 JohanAR

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.

JohanAR avatar Nov 03 '22 14:11 JohanAR

Seems like picking is broken in the current master, so this PR can't easily be tested right now.

KoBeWi avatar Nov 16 '22 14:11 KoBeWi

@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.

JohanAR avatar Nov 17 '22 07:11 JohanAR

what issue did you have with picking?

godot windows editor dev x86_64_ySQQX4bEWx

KoBeWi avatar Nov 17 '22 12:11 KoBeWi

@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

JohanAR avatar Nov 21 '22 13:11 JohanAR

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).

KoBeWi avatar Nov 21 '22 13:11 KoBeWi

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.

JohanAR avatar Nov 21 '22 13:11 JohanAR

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.

bruvzg avatar Nov 21 '22 13:11 bruvzg

Would this be superseded by #72764, or is it still relevant independently?

akien-mga avatar Feb 16 '23 21:02 akien-mga

I'll test to see if it's still necessary after that fix.

JohanAR avatar Feb 17 '23 07:02 JohanAR

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.

JohanAR avatar Feb 17 '23 08:02 JohanAR