Specialize widget::text helper with custom IntoContent trait
This commit is contained in:
parent
c30b4b0a1c
commit
1d83e59e8a
5 changed files with 78 additions and 10 deletions
|
|
@ -173,7 +173,7 @@ impl App {
|
|||
.style(button::danger);
|
||||
|
||||
row![
|
||||
text(&item.name).color(item.color),
|
||||
text(item.name.clone()).color(item.color),
|
||||
horizontal_space(),
|
||||
pick_list(Color::ALL, Some(item.color), move |color| {
|
||||
Message::ItemColorChanged(item.clone(), color)
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ impl<'a> Step {
|
|||
.into()
|
||||
}
|
||||
|
||||
fn container(title: &str) -> Column<'a, StepMessage> {
|
||||
fn container(title: &str) -> Column<'_, StepMessage> {
|
||||
column![text(title).size(50)].spacing(20)
|
||||
}
|
||||
|
||||
|
|
@ -589,7 +589,7 @@ impl<'a> Step {
|
|||
value: &str,
|
||||
is_secure: bool,
|
||||
is_showing_icon: bool,
|
||||
) -> Column<'a, StepMessage> {
|
||||
) -> Column<'_, StepMessage> {
|
||||
let mut text_input = text_input("Type something to continue...", value)
|
||||
.on_input(StepMessage::InputChanged)
|
||||
.padding(10)
|
||||
|
|
@ -674,7 +674,7 @@ fn ferris<'a>(
|
|||
.center_x()
|
||||
}
|
||||
|
||||
fn padded_button<'a, Message: Clone>(label: &str) -> Button<'a, Message> {
|
||||
fn padded_button<Message: Clone>(label: &str) -> Button<'_, Message> {
|
||||
button(text(label)).padding([12, 24])
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,11 @@ impl WebSocket {
|
|||
} else {
|
||||
scrollable(
|
||||
column(
|
||||
self.messages.iter().cloned().map(text).map(Element::from),
|
||||
self.messages
|
||||
.iter()
|
||||
.map(ToString::to_string)
|
||||
.map(text)
|
||||
.map(Element::from),
|
||||
)
|
||||
.spacing(10),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue