1
0
Fork 0

Add special styling for bypass buttons

This commit is contained in:
Robbert van der Helm 2022-11-04 15:50:03 +01:00
parent 7d4351e4fa
commit 3f0922b5c0
3 changed files with 22 additions and 1 deletions

View file

@ -43,6 +43,15 @@ param-button:checked {
transition: background-color 0.1 0; transition: background-color 0.1 0;
} }
param-button:hover {
background-color: #ffaba51a;
transition: background-color 0.1 0;
}
param-button.bypass:checked {
background-color: #ffaba5;
transition: background-color 0.1 0;
}
param-button label { param-button label {
/* TODO */ /* TODO */
} }

View file

@ -19,7 +19,7 @@ mod resize_handle;
pub mod util; pub mod util;
pub use generic_ui::GenericUi; pub use generic_ui::GenericUi;
pub use param_button::ParamButton; pub use param_button::{ParamButton, ParamButtonExt};
pub use param_slider::{ParamSlider, ParamSliderExt, ParamSliderStyle}; pub use param_slider::{ParamSlider, ParamSliderExt, ParamSliderStyle};
pub use peak_meter::PeakMeter; pub use peak_meter::PeakMeter;
pub use resize_handle::ResizeHandle; pub use resize_handle::ResizeHandle;

View file

@ -85,3 +85,15 @@ impl View for ParamButton {
}); });
} }
} }
/// Extension methods for [`ParamButton`] handles.
pub trait ParamButtonExt {
/// Change the colors scheme for a bypass button. This simply adds the `bypass` class.
fn for_bypass(self) -> Self;
}
impl ParamButtonExt for Handle<'_, ParamButton> {
fn for_bypass(self) -> Self {
self.class("bypass")
}
}