summaryrefslogtreecommitdiffstats
path: root/examples/tour.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-05 01:57:35 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-05 01:57:35 +0100
commite92ea48e8814b42fc566017db085ca9bdaf3c272 (patch)
tree48413064237f8b00b4b4c8668a96fc5ca79d995a /examples/tour.rs
parentf87ddf1056327551b4a2bba9e98cbb7816b6666c (diff)
downloadiced-e92ea48e8814b42fc566017db085ca9bdaf3c272.tar.gz
iced-e92ea48e8814b42fc566017db085ca9bdaf3c272.tar.bz2
iced-e92ea48e8814b42fc566017db085ca9bdaf3c272.zip
Make `Button::background` generic
Diffstat (limited to 'examples/tour.rs')
-rw-r--r--examples/tour.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/examples/tour.rs b/examples/tour.rs
index 53a8e662..b06fbc37 100644
--- a/examples/tour.rs
+++ b/examples/tour.rs
@@ -1,7 +1,7 @@
use iced::{
- button, scrollable, slider, text_input, Button, Checkbox,
- Color, Column, Container, Element, HorizontalAlignment, Image, Length,
- Radio, Row, Sandbox, Scrollable, Settings, Slider, Text, TextInput,
+ button, scrollable, slider, text_input, Button, Checkbox, Color, Column,
+ Container, Element, HorizontalAlignment, Image, Length, Radio, Row,
+ Sandbox, Scrollable, Settings, Slider, Text, TextInput,
};
pub fn main() {
@@ -684,17 +684,14 @@ fn primary_button<'a, Message>(
state: &'a mut button::State,
label: &str,
) -> Button<'a, Message> {
- button(state, label)
- .background(Color::from_rgb(0.11, 0.42, 0.87).into())
+ button(state, label).background(Color::from_rgb(0.11, 0.42, 0.87))
}
fn secondary_button<'a, Message>(
state: &'a mut button::State,
label: &str,
) -> Button<'a, Message> {
- button(state, label)
- .background(Color::from_rgb(0.4, 0.4, 0.4).into())
-
+ button(state, label).background(Color::from_rgb(0.4, 0.4, 0.4))
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]