Merge pull request #1856 from jhff/pane_grid_split_with_dragged_pane
[Feature] Enhance PaneGrid to split panes by drag & drop
This commit is contained in:
commit
640e13943c
5 changed files with 196 additions and 18 deletions
|
|
@ -108,8 +108,9 @@ impl Application for Example {
|
|||
Message::Dragged(pane_grid::DragEvent::Dropped {
|
||||
pane,
|
||||
target,
|
||||
region,
|
||||
}) => {
|
||||
self.panes.swap(&pane, &target);
|
||||
self.panes.split_with(&target, &pane, region);
|
||||
}
|
||||
Message::Dragged(_) => {}
|
||||
Message::TogglePin(pane) => {
|
||||
|
|
@ -255,6 +256,7 @@ fn handle_hotkey(key_code: keyboard::KeyCode) -> Option<Message> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
struct Pane {
|
||||
id: usize,
|
||||
pub is_pinned: bool,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue