From 3dbc9acc56d43756fd99599d38fae5f0743bb929 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 15 Mar 2022 13:13:47 +0100 Subject: [PATCH] Use active param slider background for text edit --- nih_plug_iced/src/widgets/param_slider.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nih_plug_iced/src/widgets/param_slider.rs b/nih_plug_iced/src/widgets/param_slider.rs index c3ef17d6..e75ef777 100644 --- a/nih_plug_iced/src/widgets/param_slider.rs +++ b/nih_plug_iced/src/widgets/param_slider.rs @@ -378,12 +378,14 @@ impl<'a, P: Param> Widget for ParamSlider<'a, P> { let bounds = layout.bounds(); let is_mouse_over = bounds.contains(cursor_position); - // The bar itself - let background_color = if is_mouse_over || self.state.drag_active { - Color::new(0.5, 0.5, 0.5, 0.1) - } else { - Color::TRANSPARENT - }; + // The bar itself, show a different background color when the value is being edited or when + // the mouse is hovering over it to indicate that it's interactive + let background_color = + if is_mouse_over || self.state.drag_active || self.state.text_input_value.is_some() { + Color::new(0.5, 0.5, 0.5, 0.1) + } else { + Color::TRANSPARENT + }; renderer.fill_quad( renderer::Quad {