Re-export variants of Length and alignment types

This commit is contained in:
Héctor Ramón Jiménez 2024-07-12 18:12:34 +02:00
parent f9dd5cbb09
commit 76737351ea
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
51 changed files with 255 additions and 395 deletions

View file

@ -3,7 +3,7 @@ mod echo;
use iced::widget::{
self, button, center, column, row, scrollable, text, text_input,
};
use iced::{color, Element, Length, Subscription, Task};
use iced::{color, Center, Element, Fill, Subscription, Task};
use once_cell::sync::Lazy;
pub fn main() -> iced::Result {
@ -103,7 +103,7 @@ impl WebSocket {
.spacing(10),
)
.id(MESSAGE_LOG.clone())
.height(Length::Fill)
.height(Fill)
.into()
};
@ -112,8 +112,8 @@ impl WebSocket {
.on_input(Message::NewMessageChanged)
.padding(10);
let mut button =
button(text("Send").height(40).center_y()).padding([0, 20]);
let mut button = button(text("Send").height(40).align_y(Center))
.padding([0, 20]);
if matches!(self.state, State::Connected(_)) {
if let Some(message) = echo::Message::new(&self.new_message) {
@ -122,11 +122,11 @@ impl WebSocket {
}
}
row![input, button].spacing(10).center_y()
row![input, button].spacing(10).align_y(Center)
};
column![message_log, new_message_input]
.height(Length::Fill)
.height(Fill)
.padding(20)
.spacing(10)
.into()