summaryrefslogtreecommitdiffstats
path: root/native/src/widget/slider.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-11-04 19:22:29 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-11-04 19:24:11 +0700
commit023aded2772f0cd6abd716fe5c8624d5d22e21fa (patch)
tree1bdb1a4584d7acc688b081a299bb4431cd35c349 /native/src/widget/slider.rs
parent343f9b7e2e594bd1fef1ed511d71e81f9c44e3d9 (diff)
downloadiced-023aded2772f0cd6abd716fe5c8624d5d22e21fa.tar.gz
iced-023aded2772f0cd6abd716fe5c8624d5d22e21fa.tar.bz2
iced-023aded2772f0cd6abd716fe5c8624d5d22e21fa.zip
Rename `fill_rectangle` to `fill_quad` in `Renderer`
Diffstat (limited to 'native/src/widget/slider.rs')
-rw-r--r--native/src/widget/slider.rs75
1 files changed, 41 insertions, 34 deletions
diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs
index 01053081..49bafab4 100644
--- a/native/src/widget/slider.rs
+++ b/native/src/widget/slider.rs
@@ -58,6 +58,7 @@ where
T: Copy + From<u8> + std::cmp::PartialOrd,
Message: Clone,
{
+ /// The default height of a [`Slider`].
pub const DEFAULT_HEIGHT: u16 = 22;
/// Creates a new [`Slider`].
@@ -272,31 +273,35 @@ where
let rail_y = bounds.y + (bounds.height / 2.0).round();
- renderer.fill_rectangle(renderer::Quad {
- bounds: Rectangle {
- x: bounds.x,
- y: rail_y,
- width: bounds.width,
- height: 2.0,
+ renderer.fill_quad(
+ renderer::Quad {
+ bounds: Rectangle {
+ x: bounds.x,
+ y: rail_y,
+ width: bounds.width,
+ height: 2.0,
+ },
+ border_radius: 0.0,
+ border_width: 0.0,
+ border_color: Color::TRANSPARENT,
},
- background: Background::Color(style.rail_colors.0),
- border_radius: 0.0,
- border_width: 0.0,
- border_color: Color::TRANSPARENT,
- });
-
- renderer.fill_rectangle(renderer::Quad {
- bounds: Rectangle {
- x: bounds.x,
- y: rail_y + 2.0,
- width: bounds.width,
- height: 2.0,
+ style.rail_colors.0,
+ );
+
+ renderer.fill_quad(
+ renderer::Quad {
+ bounds: Rectangle {
+ x: bounds.x,
+ y: rail_y + 2.0,
+ width: bounds.width,
+ height: 2.0,
+ },
+ border_radius: 0.0,
+ border_width: 0.0,
+ border_color: Color::TRANSPARENT,
},
- background: Background::Color(style.rail_colors.1),
- border_radius: 0.0,
- border_width: 0.0,
- border_color: Color::TRANSPARENT,
- });
+ Background::Color(style.rail_colors.1),
+ );
let (handle_width, handle_height, handle_border_radius) = match style
.handle
@@ -325,18 +330,20 @@ where
/ (range_end - range_start)
};
- renderer.fill_rectangle(renderer::Quad {
- bounds: Rectangle {
- x: bounds.x + handle_offset.round(),
- y: rail_y - handle_height / 2.0,
- width: handle_width,
- height: handle_height,
+ renderer.fill_quad(
+ renderer::Quad {
+ bounds: Rectangle {
+ x: bounds.x + handle_offset.round(),
+ y: rail_y - handle_height / 2.0,
+ width: handle_width,
+ height: handle_height,
+ },
+ border_radius: handle_border_radius,
+ border_width: style.handle.border_width,
+ border_color: style.handle.border_color,
},
- background: Background::Color(style.handle.color),
- border_radius: handle_border_radius,
- border_width: style.handle.border_width,
- border_color: style.handle.border_color,
- });
+ style.handle.color,
+ );
}
fn mouse_interaction(