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

Add an API to move an existing tile to an give container and position index #44

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

abey79
Copy link
Member

@abey79 abey79 commented Jan 25, 2024

Add new Tree::move_tile_to_container(), which heavily relies on the existing (but private) tile moving code

@abey79 abey79 added the enhancement New feature or request label Jan 25, 2024
@abey79 abey79 merged commit f40606f into main Jan 25, 2024
8 of 9 checks passed
@abey79 abey79 deleted the antoine/move_tile_to_container branch January 25, 2024 16:54
abey79 added a commit that referenced this pull request Jan 26, 2024
Follow-up to:
- #44

The grid layout needs a special treatment because it can have holes,
contrary to other containers.

When dragging a tile away from a grid, it leaves behind it a hole. As a
result, if the tile is dropped in the same grid, it there is no need to
account for an insertion index shift. However, if the tiles are
reordered in a separate, linear representation of the grid (such as the
Rerun blueprint tree), the expectation is that the grid is reordered and
thus the insertion index must be shifted in case the tile is moved
inside the same grid. This PR introduce a flag in
`move_tile_to_container()` to select between these behaviors.

In general:
- when drag-and-dropping from a 2D representation of the grid, set
reflow_grid = false
- when drag-and-dropping from a 1D representation of the grid, set
reflow_grid = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants