Fix multi_window example scrollable layout

This commit is contained in:
Héctor Ramón Jiménez 2025-03-24 20:28:14 +01:00
parent 5e5c7c85ad
commit 86311b8914
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -1,6 +1,6 @@
use iced::widget::{ use iced::widget::{
button, center, center_x, column, horizontal_space, scrollable, text, button, center, center_x, column, container, horizontal_space, scrollable,
text_input, text, text_input,
}; };
use iced::window; use iced::window;
use iced::{ use iced::{
@ -188,13 +188,12 @@ impl Window {
let new_window_button = let new_window_button =
button(text("New Window")).on_press(Message::OpenWindow); button(text("New Window")).on_press(Message::OpenWindow);
let content = scrollable( let content = column![scale_input, title_input, new_window_button]
column![scale_input, title_input, new_window_button]
.spacing(50) .spacing(50)
.width(Fill) .width(Fill)
.align_x(Center), .align_x(Center)
); .width(200);
center_x(content).width(200).into() container(scrollable(center_x(content))).padding(10).into()
} }
} }