Add helper functions for alignment to widget module

This commit is contained in:
Héctor Ramón Jiménez 2025-01-24 15:55:24 +01:00
parent 75a6f32a5e
commit f8337b8da7
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
12 changed files with 208 additions and 64 deletions

View file

@ -1,6 +1,6 @@
use iced_wgpu::Renderer;
use iced_widget::{column, container, row, slider, text, text_input};
use iced_winit::core::{Color, Element, Length::*, Theme};
use iced_widget::{bottom, column, row, slider, text, text_input};
use iced_winit::core::{Color, Element, Theme};
use iced_winit::runtime::{Program, Task};
pub struct Controls {
@ -74,18 +74,17 @@ impl Program for Controls {
.width(500)
.spacing(20);
container(
bottom(
column![
text("Background color").color(Color::WHITE),
text!("{background_color:?}").size(14).color(Color::WHITE),
text_input("Placeholder", &self.input)
.on_input(Message::InputChanged),
sliders,
text_input("Type something...", &self.input)
.on_input(Message::InputChanged),
]
.spacing(10),
)
.padding(10)
.align_bottom(Fill)
.into()
}
}