Keep original focus state while a pane is dragged
This commit is contained in:
parent
35b1b8b0e7
commit
3d91926a74
1 changed files with 6 additions and 2 deletions
|
|
@ -335,6 +335,7 @@ pub enum Action {
|
||||||
Dragging {
|
Dragging {
|
||||||
pane: Pane,
|
pane: Pane,
|
||||||
origin: Point,
|
origin: Point,
|
||||||
|
focus: Option<Pane>,
|
||||||
},
|
},
|
||||||
Resizing {
|
Resizing {
|
||||||
split: Split,
|
split: Split,
|
||||||
|
|
@ -362,7 +363,7 @@ impl Internal {
|
||||||
pub fn focused_pane(&self) -> Option<Pane> {
|
pub fn focused_pane(&self) -> Option<Pane> {
|
||||||
match self.action {
|
match self.action {
|
||||||
Action::Idle { focus } => focus,
|
Action::Idle { focus } => focus,
|
||||||
Action::Dragging { pane, .. } => Some(pane),
|
Action::Dragging { focus, .. } => focus,
|
||||||
Action::Resizing { focus, .. } => focus,
|
Action::Resizing { focus, .. } => focus,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -376,7 +377,7 @@ impl Internal {
|
||||||
|
|
||||||
pub fn picked_pane(&self) -> Option<(Pane, Point)> {
|
pub fn picked_pane(&self) -> Option<(Pane, Point)> {
|
||||||
match self.action {
|
match self.action {
|
||||||
Action::Dragging { pane, origin } => Some((pane, origin)),
|
Action::Dragging { pane, origin, .. } => Some((pane, origin)),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -409,9 +410,12 @@ impl Internal {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn pick_pane(&mut self, pane: &Pane, origin: Point) {
|
pub fn pick_pane(&mut self, pane: &Pane, origin: Point) {
|
||||||
|
let focus = self.focused_pane();
|
||||||
|
|
||||||
self.action = Action::Dragging {
|
self.action = Action::Dragging {
|
||||||
pane: *pane,
|
pane: *pane,
|
||||||
origin,
|
origin,
|
||||||
|
focus,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue