From cb530ccf2f0ba82e49be317a14eb61025777a24e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 30 Jun 2020 00:32:55 +0200 Subject: Rename `regions` and `splits` in `pane_grid::Node` --- native/src/widget/pane_grid/state.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'native/src/widget/pane_grid/state.rs') diff --git a/native/src/widget/pane_grid/state.rs b/native/src/widget/pane_grid/state.rs index 4b13fb8e..57fdbc55 100644 --- a/native/src/widget/pane_grid/state.rs +++ b/native/src/widget/pane_grid/state.rs @@ -154,8 +154,10 @@ impl State { /// [`Pane`]: struct.Pane.html /// [`State::active`]: struct.State.html#method.active pub fn adjacent(&self, pane: &Pane, direction: Direction) -> Option { - let regions = - self.internal.layout.regions(0.0, Size::new(4096.0, 4096.0)); + let regions = self + .internal + .layout + .pane_regions(0.0, Size::new(4096.0, 4096.0)); let current_region = regions.get(pane)?; @@ -362,20 +364,20 @@ impl Internal { } } - pub fn regions( + pub fn pane_regions( &self, spacing: f32, size: Size, ) -> HashMap { - self.layout.regions(spacing, size) + self.layout.pane_regions(spacing, size) } - pub fn splits( + pub fn split_regions( &self, spacing: f32, size: Size, ) -> HashMap { - self.layout.splits(spacing, size) + self.layout.split_regions(spacing, size) } pub fn focus(&mut self, pane: &Pane) { -- cgit From e50c61f7ff8c7bd559afb66025eaded78ca423bb Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 30 Jun 2020 02:53:15 +0200 Subject: Add `unfocus` method to `pane_grid::State` --- native/src/widget/pane_grid/state.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'native/src/widget/pane_grid/state.rs') diff --git a/native/src/widget/pane_grid/state.rs b/native/src/widget/pane_grid/state.rs index 57fdbc55..a4cfb6f6 100644 --- a/native/src/widget/pane_grid/state.rs +++ b/native/src/widget/pane_grid/state.rs @@ -193,6 +193,13 @@ impl State { self.internal.focus(pane); } + /// Unfocuses the current focused [`Pane`]. + /// + /// [`Pane`]: struct.Pane.html + pub fn unfocus(&mut self) { + self.internal.unfocus(); + } + /// Splits the given [`Pane`] into two in the given [`Axis`] and /// initializing the new [`Pane`] with the provided internal state. /// -- cgit