mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Use active param slider background for text edit
This commit is contained in:
@@ -378,12 +378,14 @@ impl<'a, P: Param> Widget<ParamMessage, Renderer> for ParamSlider<'a, P> {
|
|||||||
let bounds = layout.bounds();
|
let bounds = layout.bounds();
|
||||||
let is_mouse_over = bounds.contains(cursor_position);
|
let is_mouse_over = bounds.contains(cursor_position);
|
||||||
|
|
||||||
// The bar itself
|
// The bar itself, show a different background color when the value is being edited or when
|
||||||
let background_color = if is_mouse_over || self.state.drag_active {
|
// the mouse is hovering over it to indicate that it's interactive
|
||||||
Color::new(0.5, 0.5, 0.5, 0.1)
|
let background_color =
|
||||||
} else {
|
if is_mouse_over || self.state.drag_active || self.state.text_input_value.is_some() {
|
||||||
Color::TRANSPARENT
|
Color::new(0.5, 0.5, 0.5, 0.1)
|
||||||
};
|
} else {
|
||||||
|
Color::TRANSPARENT
|
||||||
|
};
|
||||||
|
|
||||||
renderer.fill_quad(
|
renderer.fill_quad(
|
||||||
renderer::Quad {
|
renderer::Quad {
|
||||||
|
|||||||
Reference in New Issue
Block a user