Adjust some of the styles to the new Toggleable format

This commit is contained in:
Piotr Osiewicz 2023-06-15 16:24:05 +02:00 committed by Mikayla Maki
parent 198a446b03
commit 31c1177737
No known key found for this signature in database
15 changed files with 1932 additions and 1808 deletions

View file

@ -219,7 +219,7 @@ impl View for Toolbar {
#[allow(clippy::too_many_arguments)]
fn nav_button<A: Action, F: 'static + Fn(&mut Toolbar, &mut ViewContext<Toolbar>)>(
svg_path: &'static str,
style: theme::Toggleable<theme::Interactive<theme::IconButton>>,
style: theme::Interactive<theme::IconButton>,
nav_button_height: f32,
tooltip_style: TooltipStyle,
enabled: bool,
@ -231,9 +231,9 @@ fn nav_button<A: Action, F: 'static + Fn(&mut Toolbar, &mut ViewContext<Toolbar>
) -> AnyElement<Toolbar> {
MouseEventHandler::<A, _>::new(0, cx, |state, _| {
let style = if enabled {
style.inactive_state().style_for(state)
style.style_for(state)
} else {
style.inactive_state().disabled_style()
style.disabled_style()
};
Svg::new(svg_path)
.with_color(style.color)