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

ColorSwatchPlugValueWidget : Fix dialogue for Tool plugs #4698

Merged
merged 1 commit into from
Jun 6, 2022

Conversation

johnhaddon
Copy link
Member

I'm not sure if this is the right long-term fix or not, but it works for our immediate needs (a custom Tool subclass with a ColorPlug). It wouldn't work for, say, a plug in the LightEditor settings, where there's no way of finding the script from the parent-less settings node. As discussed in #50, it might be ideal if the entire UI hierarchy was specified via Nodes/Plugs, and then this approach could work for the LightEditor and everything else too.

An alternative approach would be to pass a forWidget argument to acquire() and then find a suitable parent window for the dialogue from that. But that is a bit harder to use, and also means we could end up with multiple colour dialogues (under different windows) for the same plug, which is what we're trying to avoid.

@johnhaddon johnhaddon requested a review from ericmehl June 6, 2022 11:56
@johnhaddon johnhaddon self-assigned this Jun 6, 2022
Copy link
Collaborator

@ericmehl ericmehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericmehl
Copy link
Collaborator

ericmehl commented Jun 6, 2022

I updated Changes.md to resolve the conflict with other PRs just merged, though I'm not entirely happy that using the web editor created a new commit.

Is there a better way of resolving these simple merge conflicts? I was hoping it would do some equivalent of a force-push to just edit the one commit in place.

@johnhaddon
Copy link
Member Author

I don't know of a better way - I'll force-push something from here.

I'm not sure if this is the right long-term fix or not, but it works for our immediate needs (a custom Tool subclass with a ColorPlug). It wouldn't work for, say, a plug in the LightEditor settings, where there's no way of finding the script from the parent-less settings node. As discussed in GafferHQ#50, it might be ideal if the entire UI hierarchy was specified via Nodes/Plugs, and then this approach could work for the LightEditor and everything else too.

An alternative approach would be to pass a `forWidget` argument to `acquire()` and then find a suitable parent window for the dialogue from that. But that is a bit harder to use, and also means we could end up with multiple colour dialogues (under different windows) for the same plug, which is what we're trying to avoid.
@ericmehl ericmehl merged commit 24e36e0 into GafferHQ:0.61_maintenance Jun 6, 2022
@johnhaddon johnhaddon deleted the toolColorPlugFix branch June 20, 2022 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants