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

PortableColorPicker MouseUp event should be raised when ending a push+drag action on the HSV/HSL/RGB sliders #52

Open
vchelaru opened this issue Nov 30, 2024 · 0 comments

Comments

@vchelaru
Copy link

vchelaru commented Nov 30, 2024

Summary

MouseUp events should be raised whenever the mouse is pushed, dragged, then released on any of the sliders in the HSV/HSL/RGB tabs.

Reproduction Steps

  1. Create a PortableColorPicker instance
  2. Add a MouseUp event handler for the instance
  3. Add code to handle the mouse up event by printing output so that you can see when the event is raised
  4. Run the application
  5. Expand the picker
  6. Push+drag on any of the values in the HSV/HSL/RGB sliders

Observe - MouseUp is not raised
Expected - MouseUp is raised

Additional info - The MouseUp event is raised when performing the following actions:

  • Clicking on the ring for picking hue
  • Dragging on the ring for picking hue
  • Clicking on the box for picking saturation and brightness
  • Dragging on the box for picking saturation and brightness
  • Clicking on any of the HSV/HSL/RGB sliders

Only push+drag is inconsistent - it does not raise the event

System Info

  • Windows 11
  • WPF
  • .NET 4.7.2

GIFs

The following gif shows the correct behavior for all of the operations outlined as working in the Additional info section above. Note that I am showing the UI and also the output window printing changes.

30_07 29 22

The following gif shows the incorrect behavior where the event is not raised on a push+drag:

30_07 30 39

Use Case

The ability to detect a moue click on the control is very important for the application I am developing - https://github.com/vchelaru/Gum

This application records operations for undo, and performs auto-saving of the project whenever a variable changes. Unfortunately, performing undos and saving whenever the ColorChanged event is raised is problematic because it causes a LOT of file IO and dozens of undo snapshots being stored.

Instead, I'd like to respond to whenever the color value change is committed rather than while the change is still happening during a drag. I haven't found any events for determining if a color change occurred while the user is still dragging compared to when the user has finished dragging, so to work around this I'm subscribing to the MouseUp event. This works fine in most cases, but it is not being raised whenever the mouse is dragged over the sliders.

Update 1

PreviewMouseUp seems to be raised for all controls so this is a suitable workaround for me. I'm not sure if the behavior listed above is as intended or not, so I'll leave the issue open in case it is actually a bug. Feel free to close if it's working as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant