From 80db6121f3268e9346a9432ecafbf7ba4865ddcc Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 19 Mar 2022 17:47:50 +0100 Subject: [PATCH] Add some more styling for the vizia ParamSlider This still doesn't really work well since we can't focus the textbox. --- nih_plug_vizia/assets/theme.css | 7 +++++++ nih_plug_vizia/src/widgets/param_slider.rs | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nih_plug_vizia/assets/theme.css b/nih_plug_vizia/assets/theme.css index be2ec6f9..4a6fb236 100644 --- a/nih_plug_vizia/assets/theme.css +++ b/nih_plug_vizia/assets/theme.css @@ -23,3 +23,10 @@ param-slider:hover { param-slider .fill { background-color: #c4c4c4; } + +/* This is a textbox, but we want it to appear just like the label */ +param-slider .value-entry { + /* Vizia doesn't support the unset value */ + background-color: transparent; + border-width: 0px; +} diff --git a/nih_plug_vizia/src/widgets/param_slider.rs b/nih_plug_vizia/src/widgets/param_slider.rs index 0ef719f1..03b5e359 100644 --- a/nih_plug_vizia/src/widgets/param_slider.rs +++ b/nih_plug_vizia/src/widgets/param_slider.rs @@ -55,9 +55,10 @@ enum ParamSliderInternalEvent { } impl Model for ParamSliderInternal { - fn event(&mut self, _cx: &mut Context, event: &mut Event) { + fn event(&mut self, cx: &mut Context, event: &mut Event) { if let Some(ParamSliderInternalEvent::SetTextInputActive(value)) = event.message.downcast() { + cx.current.set_active(cx, *value); self.text_input_active = *value; } }