Skip to content

Commit 9452870

Browse files
committed
minor improvements to slider and scrollbar stylesheets
1 parent 65f8a4a commit 9452870

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

src/gui/pages/settings_notifications_page.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ fn volume_slider(language: Language, style: StyleType, volume: u8) -> Container<
425425
ElementType::Standard,
426426
))),
427427
)
428-
.push(horizontal_space(Length::Fixed(10.0)))
428+
.push(horizontal_space(Length::Fixed(15.0)))
429429
.push(
430-
Text::new('Z'.to_string())
430+
Text::new("Z")
431431
.vertical_alignment(Vertical::Center)
432432
.size(20)
433433
.font(ICONS),

src/gui/styles/scrollbar.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl iced::widget::scrollable::StyleSheet for StyleTuple {
3333
}
3434
}
3535

36-
fn hovered(&self, _: &Self::Style, _is_mouse_over_scrollbar: bool) -> Scrollbar {
36+
fn hovered(&self, _: &Self::Style, is_mouse_over_scrollbar: bool) -> Scrollbar {
3737
let colors = get_colors(self.0);
3838
Scrollbar {
3939
background: Some(Background::Color(colors.round_borders)),
@@ -43,7 +43,11 @@ impl iced::widget::scrollable::StyleSheet for StyleTuple {
4343
scroller: Scroller {
4444
color: colors.secondary,
4545
border_radius: BORDER_ROUNDED_RADIUS,
46-
border_width: BORDER_WIDTH * 1.5,
46+
border_width: if is_mouse_over_scrollbar {
47+
BORDER_WIDTH * 1.25
48+
} else {
49+
BORDER_WIDTH * 1.75
50+
},
4751
border_color: Color::TRANSPARENT,
4852
},
4953
}

src/gui/styles/slider.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use iced_native::widget::vertical_slider::HandleShape;
66

77
use crate::get_colors;
88
use crate::gui::styles::style_constants::BORDER_WIDTH;
9+
use crate::gui::styles::types::palette::mix_colors;
910
use crate::gui::styles::types::style_tuple::StyleTuple;
1011

1112
impl From<StyleTuple> for iced::theme::Slider {
@@ -25,7 +26,7 @@ impl iced::widget::slider::StyleSheet for StyleTuple {
2526
width: 3.0,
2627
},
2728
handle: Handle {
28-
shape: HandleShape::Circle { radius: 7.0 },
29+
shape: HandleShape::Circle { radius: 5.0 },
2930
color: colors.primary,
3031
border_width: BORDER_WIDTH,
3132
border_color: colors.secondary,
@@ -41,8 +42,8 @@ impl iced::widget::slider::StyleSheet for StyleTuple {
4142
width: 3.0,
4243
},
4344
handle: Handle {
44-
shape: HandleShape::Circle { radius: 7.0 },
45-
color: colors.secondary,
45+
shape: HandleShape::Circle { radius: 8.0 },
46+
color: mix_colors(colors.primary, colors.buttons),
4647
border_width: BORDER_WIDTH,
4748
border_color: colors.secondary,
4849
},
@@ -57,8 +58,8 @@ impl iced::widget::slider::StyleSheet for StyleTuple {
5758
width: 3.0,
5859
},
5960
handle: Handle {
60-
shape: HandleShape::Circle { radius: 7.0 },
61-
color: colors.secondary,
61+
shape: HandleShape::Circle { radius: 8.0 },
62+
color: mix_colors(colors.primary, colors.buttons),
6263
border_width: BORDER_WIDTH,
6364
border_color: colors.secondary,
6465
},

0 commit comments

Comments
 (0)