summaryrefslogtreecommitdiffstats
path: root/examples/integration/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-06-13 13:21:49 +0200
committerLibravatar GitHub <noreply@github.com>2020-06-13 13:21:49 +0200
commitf131969c47bb4a32d60d5be4c2bece0688b0a418 (patch)
tree769fbc48ce33bfcbe0504ae6efc9c9642cd78fc5 /examples/integration/src
parent2a516dfc4823feb16054e8d484637014e4eedcce (diff)
parentc3643eaf6d90dc8b60c0b762200bf1f8097cdfe9 (diff)
downloadiced-f131969c47bb4a32d60d5be4c2bece0688b0a418.tar.gz
iced-f131969c47bb4a32d60d5be4c2bece0688b0a418.tar.bz2
iced-f131969c47bb4a32d60d5be4c2bece0688b0a418.zip
Merge pull request #381 from loewenheim/slider_step
Added `step` member to slider widgets
Diffstat (limited to 'examples/integration/src')
-rw-r--r--examples/integration/src/controls.rs39
1 files changed, 24 insertions, 15 deletions
diff --git a/examples/integration/src/controls.rs b/examples/integration/src/controls.rs
index e6e74995..824f9f53 100644
--- a/examples/integration/src/controls.rs
+++ b/examples/integration/src/controls.rs
@@ -48,24 +48,33 @@ impl Program for Controls {
let sliders = Row::new()
.width(Length::Units(500))
.spacing(20)
- .push(Slider::new(r, 0.0..=1.0, background_color.r, move |r| {
- Message::BackgroundColorChanged(Color {
- r,
- ..background_color
+ .push(
+ Slider::new(r, 0.0..=1.0, background_color.r, move |r| {
+ Message::BackgroundColorChanged(Color {
+ r,
+ ..background_color
+ })
})
- }))
- .push(Slider::new(g, 0.0..=1.0, background_color.g, move |g| {
- Message::BackgroundColorChanged(Color {
- g,
- ..background_color
+ .step(0.01),
+ )
+ .push(
+ Slider::new(g, 0.0..=1.0, background_color.g, move |g| {
+ Message::BackgroundColorChanged(Color {
+ g,
+ ..background_color
+ })
})
- }))
- .push(Slider::new(b, 0.0..=1.0, background_color.b, move |b| {
- Message::BackgroundColorChanged(Color {
- b,
- ..background_color
+ .step(0.01),
+ )
+ .push(
+ Slider::new(b, 0.0..=1.0, background_color.b, move |b| {
+ Message::BackgroundColorChanged(Color {
+ b,
+ ..background_color
+ })
})
- }));
+ .step(0.01),
+ );
Row::new()
.width(Length::Fill)