From cfc2b55e05a3dc20eae71088d0475f82e34ea36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 20 Mar 2020 11:54:42 +0100 Subject: [PATCH] Rename `Internal::idle_pane` to `active_pane` --- native/src/widget/pane_grid.rs | 2 +- native/src/widget/pane_grid/state.rs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index 5b609b56..7e547ccb 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -533,7 +533,7 @@ where if let Some(on_key_press) = &self.on_key_press { // TODO: Discard when event is captured if state == ButtonState::Pressed { - if let Some(_) = self.state.idle_pane() { + if let Some(_) = self.state.active_pane() { if modifiers.matches(self.modifier_keys) { if let Some(message) = on_key_press(KeyPressEvent { diff --git a/native/src/widget/pane_grid/state.rs b/native/src/widget/pane_grid/state.rs index 0e528d90..0a8b8419 100644 --- a/native/src/widget/pane_grid/state.rs +++ b/native/src/widget/pane_grid/state.rs @@ -109,10 +109,7 @@ impl State { /// [`Pane`]: struct.Pane.html /// [`State`]: struct.State.html pub fn active(&self) -> Option { - match self.internal.action { - Action::Idle { focus } => focus, - _ => None, - } + self.internal.active_pane() } /// Returns the adjacent [`Pane`] of another [`Pane`] in the given @@ -289,7 +286,7 @@ impl Internal { self.action } - pub fn idle_pane(&self) -> Option { + pub fn active_pane(&self) -> Option { match self.action { Action::Idle { focus } => focus, _ => None,