Group preset list and clear button in game_of_life example

This commit is contained in:
Héctor Ramón Jiménez 2024-03-08 00:38:02 +01:00
parent f316755cdc
commit 76627bb481
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -185,17 +185,14 @@ fn view_controls<'a>(
row![ row![
playback_controls, playback_controls,
speed_controls, speed_controls,
checkbox("Grid", is_grid_enabled) checkbox("Grid", is_grid_enabled).on_toggle(Message::ToggleGrid),
.on_toggle(Message::ToggleGrid) row![
.size(16) pick_list(preset::ALL, Some(preset), Message::PresetPicked),
.spacing(5) button("Clear")
.text_size(16), .on_press(Message::Clear)
pick_list(preset::ALL, Some(preset), Message::PresetPicked) .style(button::danger)
.padding(8) ]
.text_size(16), .spacing(10)
button("Clear")
.on_press(Message::Clear)
.style(button::danger),
] ]
.padding(10) .padding(10)
.spacing(20) .spacing(20)