minor improvements to slider and scrollbar stylesheets

This commit is contained in:
Giuliano Bellini s294739 2023-04-15 10:45:25 +02:00
parent 98582e1618
commit b248fcc7fd
3 changed files with 14 additions and 9 deletions

View file

@ -425,9 +425,9 @@ fn volume_slider(language: Language, style: StyleType, volume: u8) -> Container<
ElementType::Standard,
))),
)
.push(horizontal_space(Length::Fixed(10.0)))
.push(horizontal_space(Length::Fixed(15.0)))
.push(
Text::new('Z'.to_string())
Text::new("Z")
.vertical_alignment(Vertical::Center)
.size(20)
.font(ICONS),

View file

@ -33,7 +33,7 @@ impl iced::widget::scrollable::StyleSheet for StyleTuple {
}
}
fn hovered(&self, _: &Self::Style, _is_mouse_over_scrollbar: bool) -> Scrollbar {
fn hovered(&self, _: &Self::Style, is_mouse_over_scrollbar: bool) -> Scrollbar {
let colors = get_colors(self.0);
Scrollbar {
background: Some(Background::Color(colors.round_borders)),
@ -43,7 +43,11 @@ impl iced::widget::scrollable::StyleSheet for StyleTuple {
scroller: Scroller {
color: colors.secondary,
border_radius: BORDER_ROUNDED_RADIUS,
border_width: BORDER_WIDTH * 1.5,
border_width: if is_mouse_over_scrollbar {
BORDER_WIDTH * 1.25
} else {
BORDER_WIDTH * 1.75
},
border_color: Color::TRANSPARENT,
},
}

View file

@ -6,6 +6,7 @@ use iced_native::widget::vertical_slider::HandleShape;
use crate::get_colors;
use crate::gui::styles::style_constants::BORDER_WIDTH;
use crate::gui::styles::types::palette::mix_colors;
use crate::gui::styles::types::style_tuple::StyleTuple;
impl From<StyleTuple> for iced::theme::Slider {
@ -25,7 +26,7 @@ impl iced::widget::slider::StyleSheet for StyleTuple {
width: 3.0,
},
handle: Handle {
shape: HandleShape::Circle { radius: 7.0 },
shape: HandleShape::Circle { radius: 5.0 },
color: colors.primary,
border_width: BORDER_WIDTH,
border_color: colors.secondary,
@ -41,8 +42,8 @@ impl iced::widget::slider::StyleSheet for StyleTuple {
width: 3.0,
},
handle: Handle {
shape: HandleShape::Circle { radius: 7.0 },
color: colors.secondary,
shape: HandleShape::Circle { radius: 8.0 },
color: mix_colors(colors.primary, colors.buttons),
border_width: BORDER_WIDTH,
border_color: colors.secondary,
},
@ -57,8 +58,8 @@ impl iced::widget::slider::StyleSheet for StyleTuple {
width: 3.0,
},
handle: Handle {
shape: HandleShape::Circle { radius: 7.0 },
color: colors.secondary,
shape: HandleShape::Circle { radius: 8.0 },
color: mix_colors(colors.primary, colors.buttons),
border_width: BORDER_WIDTH,
border_color: colors.secondary,
},