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

@ -4,7 +4,7 @@ use iced::keyboard::key;
use iced::widget::{
self, button, center, column, pick_list, row, slider, text, text_input,
};
use iced::{Element, Length, Subscription, Task};
use iced::{Center, Element, Fill, Subscription, Task};
use toast::{Status, Toast};
@ -125,7 +125,7 @@ impl App {
Some(self.editing.status),
Message::Status
)
.width(Length::Fill)
.width(Fill)
.into()
),
subtitle(
@ -142,7 +142,7 @@ impl App {
.spacing(5)
.into()
),
column![add_toast].center_x()
column![add_toast].align_x(Center)
]
.spacing(10)
.max_width(200),
@ -177,8 +177,8 @@ mod toast {
};
use iced::window;
use iced::{
Alignment, Element, Length, Point, Rectangle, Renderer, Size, Theme,
Vector,
Alignment, Center, Element, Fill, Length, Point, Rectangle, Renderer,
Size, Theme, Vector,
};
pub const DEFAULT_TIMEOUT: u64 = 5;
@ -245,9 +245,9 @@ mod toast {
.on_press((on_close)(index))
.padding(3),
]
.center_y()
.align_y(Center)
)
.width(Length::Fill)
.width(Fill)
.padding(5)
.style(match toast.status {
Status::Primary => primary,
@ -257,7 +257,7 @@ mod toast {
}),
horizontal_rule(1),
container(text(toast.body.as_str()))
.width(Length::Fill)
.width(Fill)
.padding(5)
.style(container::rounded_box),
])
@ -479,8 +479,8 @@ mod toast {
layout::flex::Axis::Vertical,
renderer,
&limits,
Length::Fill,
Length::Fill,
Fill,
Fill,
10.into(),
10.0,
Alignment::End,