[Feature] Pane Grid: drag & drop panes to the edges #1865
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Previously, in order to create a new column or row on a
PaneGrid
, a client would necessarily have to create and remove panes, as it was only able to split existing panes.Following #1856, this change adds the ability to drag & drop panes of a
PaneGrid
to its edges in order to enhance even more an easy layout customisation of the grid.Implementation
DragEvent::Dropped
instead ofPane
andRegion
parameters, now holds aTarget
that can either beTarget::PaneGrid
(new variant, that wraps anEdge
) orTarget::Pane
(which holds the previous parameters).Users of
PaneGrid
can callpane_grid::State::move_to_edge(pane, edge)
in order to create a new row/column depending on theedge
with thatpane
'sstate
. This will split the majorNode
of the grid in order to create said row/column.Hovered
PaneGrid
edges are detected and highlighted with the minimum thickness of either the total grid height or width ratio of1/25
. I feel it is a good balance after some experimentation, but I'm up to change this.Demo
pane_grid_edges.mov