From 61c60b5c73b28e25eb69cc3732c9d2d47ac208fc Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 15 Mar 2022 12:49:43 +0100 Subject: [PATCH] Preselect the entire text entry dialog --- nih_plug_iced/src/widgets/param_slider.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nih_plug_iced/src/widgets/param_slider.rs b/nih_plug_iced/src/widgets/param_slider.rs index d57d9289..25703d50 100644 --- a/nih_plug_iced/src/widgets/param_slider.rs +++ b/nih_plug_iced/src/widgets/param_slider.rs @@ -237,11 +237,10 @@ impl<'a, P: Param> Widget for ParamSlider<'a, P> { // widget self.state.drag_active = false; + let mut text_input_state = self.state.text_input_state.borrow_mut(); self.state.text_input_value = Some(self.param.to_string()); - self.state - .text_input_state - .borrow_mut() - .move_cursor_to_end(); + text_input_state.move_cursor_to_end(); + text_input_state.select_all(); } else if self.state.keyboard_modifiers.command() || matches!(click.kind(), mouse::click::Kind::Double) {