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

Rework spot addition and link toggling in BDV views #346

Merged
merged 8 commits into from
Nov 11, 2024
Merged

Conversation

tinevez
Copy link
Contributor

@tinevez tinevez commented Nov 10, 2024

This PR implements adds new Behaviour for adding new spots and linking to new spots. It supersedes and implement the behaviour of several actions and behaviours at once, in a single key-stroke:

  • the add spot action
  • the toggle link behaviour
  • the add and link to spot behaviour

A single key (A by default, and C to go backward in time) is used to implement all their features:

If there are no spots where the mouse is clicked, a new spot is created, which can be positionned by holding the key and moving the mouse.

If the key is pressed from within a source spot, the viewer moves to the next (or previous for its counterpart binding) time point and offers to create a new spot linked to this source.
Hold and drag to position the new spot. A new spot will be created where the mouse is released, and linked to the source spot.

If a target spot is found near the mouse location when the key is released, it is linked to the source spot. If a link already exists between the two, it is removed.

…keymaps.

Goal is to replace them by something better.
This new behaviour tries to encompass all what the 'add spot' and
'add linked spot' do.
If 'A' (the default key binding) is pressed in a zon without a spot,
a new spot is created. If it is pressed within a spot, the viewer
moves to the next frame ('C' to move to the previous one) and the user
can drag around to create a new linked spot there. If the key is
released in a zone without any spots, a new one is created, from the
source spot. If a spot is found near where the mouse is released,
the source spot is linked to this one.
Let's benefit from the fact that we do everything from a
behaviour.
This way we also implement what is defined in the 'toggle link'
behaviour.
Now all spot addition and link toggling in BDV views are done with
the new add or link action.
@tinevez tinevez merged commit b823f50 into dev Nov 11, 2024
1 check passed
@tinevez tinevez deleted the rework-add-spot branch November 11, 2024 15:49
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.

1 participant