Add pane_grid functionality to split a pane with another pane
This commit is contained in:
parent
8e8b1e1eac
commit
99aa54cd88
5 changed files with 198 additions and 7 deletions
|
|
@ -108,8 +108,12 @@ impl Application for Example {
|
|||
Message::Dragged(pane_grid::DragEvent::Dropped {
|
||||
pane,
|
||||
target,
|
||||
region,
|
||||
}) => {
|
||||
self.panes.swap(&pane, &target);
|
||||
if let Some(state) = self.panes.get(&pane) {
|
||||
let pane = (*state, &pane);
|
||||
self.panes.split_with(&target, pane, region);
|
||||
}
|
||||
}
|
||||
Message::Dragged(_) => {}
|
||||
Message::TogglePin(pane) => {
|
||||
|
|
@ -255,6 +259,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