summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-14 04:53:57 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-14 04:53:57 +0100
commit460565056e6787d5cc7cb0d1d49c9e8ff1f77850 (patch)
treee737eed86a5c3ace86fe0301596a6a27126d18ee /native
parent2459648574abc11161390b24d8b0b621b5d39ab9 (diff)
downloadiced-460565056e6787d5cc7cb0d1d49c9e8ff1f77850.tar.gz
iced-460565056e6787d5cc7cb0d1d49c9e8ff1f77850.tar.bz2
iced-460565056e6787d5cc7cb0d1d49c9e8ff1f77850.zip
Reuse `PaneGrid::focus` to remove some duplication
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/pane_grid.rs11
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