diff options
author | 2020-03-14 04:53:57 +0100 | |
---|---|---|
committer | 2020-03-14 04:53:57 +0100 | |
commit | 460565056e6787d5cc7cb0d1d49c9e8ff1f77850 (patch) | |
tree | e737eed86a5c3ace86fe0301596a6a27126d18ee | |
parent | 2459648574abc11161390b24d8b0b621b5d39ab9 (diff) | |
download | iced-460565056e6787d5cc7cb0d1d49c9e8ff1f77850.tar.gz iced-460565056e6787d5cc7cb0d1d49c9e8ff1f77850.tar.bz2 iced-460565056e6787d5cc7cb0d1d49c9e8ff1f77850.zip |
Reuse `PaneGrid::focus` to remove some duplication
-rw-r--r-- | native/src/widget/pane_grid.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index a594832a..32dc4236 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -449,10 +449,7 @@ impl<T> State<T> { node.split(kind, new_pane); let _ = self.panes.insert(new_pane, state); - self.internal.focused_pane = FocusedPane::Some { - pane: new_pane, - focus: Focus::Idle, - }; + self.focus(&new_pane); Some(new_pane) } @@ -472,11 +469,7 @@ impl<T> State<T> { pub fn close(&mut self, pane: &Pane) -> Option<T> { if let Some(sibling) = self.internal.layout.remove(pane) { - self.internal.focused_pane = FocusedPane::Some { - pane: sibling, - focus: Focus::Idle, - }; - + self.focus(&sibling); self.panes.remove(pane) } else { None |