diff options
author | 2024-09-10 22:30:37 +0100 | |
---|---|---|
committer | 2024-09-10 21:30:37 +0000 | |
commit | abd323181d613f1dc69b6cbe885dce556f427de2 (patch) | |
tree | b2481b983e397fa6fc6c932a7fc0bd3a2a1b6b2e /widget/src/vertical_slider.rs | |
parent | ae58a40398bd02b07c1d7ca41681ae52b9ddde58 (diff) | |
download | iced-abd323181d613f1dc69b6cbe885dce556f427de2.tar.gz iced-abd323181d613f1dc69b6cbe885dce556f427de2.tar.bz2 iced-abd323181d613f1dc69b6cbe885dce556f427de2.zip |
Improve slider widget styling. (#2444)
* Overhaul slider styling
* Add `border` attribute to `Rail`
* Replace `color` attribute with `background` for handle
* Replace `colors` with `backgrounds` for the Rail.
* code consistency
* remove unused import
Diffstat (limited to '')
-rw-r--r-- | widget/src/vertical_slider.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/widget/src/vertical_slider.rs b/widget/src/vertical_slider.rs index f21b996c..03ec374c 100644 --- a/widget/src/vertical_slider.rs +++ b/widget/src/vertical_slider.rs @@ -5,7 +5,7 @@ pub use crate::slider::{ default, Catalog, Handle, HandleShape, Status, Style, StyleFn, }; -use crate::core::border::{self, Border}; +use crate::core::border::Border; use crate::core::event::{self, Event}; use crate::core::keyboard; use crate::core::keyboard::key::{self, Key}; @@ -413,10 +413,10 @@ where width: style.rail.width, height: offset + handle_width / 2.0, }, - border: border::rounded(style.rail.border_radius), + border: style.rail.border, ..renderer::Quad::default() }, - style.rail.colors.1, + style.rail.backgrounds.1, ); renderer.fill_quad( @@ -427,10 +427,10 @@ where width: style.rail.width, height: bounds.height - offset - handle_width / 2.0, }, - border: border::rounded(style.rail.border_radius), + border: style.rail.border, ..renderer::Quad::default() }, - style.rail.colors.0, + style.rail.backgrounds.0, ); renderer.fill_quad( @@ -448,7 +448,7 @@ where }, ..renderer::Quad::default() }, - style.handle.color, + style.handle.background, ); } |