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

Crop Window Toggle #5518

Merged
merged 2 commits into from
Nov 15, 2023
Merged

Crop Window Toggle #5518

merged 2 commits into from
Nov 15, 2023

Conversation

ericmehl
Copy link
Collaborator

This changes two related behaviors :

  1. Allows all tools, not just non-exclusive tools, to be toggled off with a keyboard shortcut.
  2. Adds Alt+C shortcut to toggle off the crop window tool as well as the crop window itself, for the plug used for the crop window tool.

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Gaffer project's prevailing coding style and conventions.

src/GafferUI/View.cpp Outdated Show resolved Hide resolved
src/GafferUI/View.cpp Show resolved Hide resolved
src/GafferSceneUI/CropWindowTool.cpp Outdated Show resolved Hide resolved
@ericmehl ericmehl changed the base branch from 1.3_maintenance to main November 8, 2023 19:47
@ericmehl
Copy link
Collaborator Author

ericmehl commented Nov 8, 2023

I addressed the comments above - despite it being a bit weird that two of the CI builds failed in tests, I think this is ready for another look. Those failures seem unrelated.

Copy link
Member

@johnhaddon johnhaddon left a comment

Choose a reason for hiding this comment

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

Sorry Eric, I spotted one more problem that I should have spotted the first time around - see inline comment. Otherwise LGTM - could you squash everything appropriately while adding the UndoScope and then we can merge?

src/GafferSceneUI/CropWindowTool.cpp Show resolved Hide resolved
@johnhaddon
Copy link
Member

Those failures seem unrelated.

Definitely. I've pushed bf248a4 to take care of one of them. The Windows one I've seen before too, but don't know the cause yet.

@ericmehl
Copy link
Collaborator Author

ericmehl commented Nov 9, 2023

Squashed and ready for merging as long as my UndoScope is in fact placed properly.

Previously we were only toggling non-exclusive tools off with keyboard
shortcuts. This changes toggle behavior to activate the first tool in
a toolbar when an exclusive tool is toggled off. This is initially
motivated by the desire to be able to toggle off the CropWindowTool.
void toolsChildAdded( Gaffer::GraphComponent *child );
void toolPlugSet( Gaffer::Plug *plug );

using ToolPlugSetMap = std::unordered_map<Tool *, Gaffer::Signals::ScopedConnection>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the last push, I changed this to be keyed to Tool * instead of the name of the tool. Though we don't expect the tool name to change, it is possible. Keying on Tool * is more reliable.

@ericmehl ericmehl merged commit 584a228 into GafferHQ:main Nov 15, 2023
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants