summaryrefslogtreecommitdiffstats
path: root/examples/toast
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-12 18:12:34 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-12 18:12:34 +0200
commit76737351ea9e116291112b7d576d9ed4f6bb5c2a (patch)
treea3b514583ab6f8981fb7656adb9d4d10ce9c466a /examples/toast
parentf9dd5cbb099bbe44a57b6369be54a442363b7a8d (diff)
downloadiced-76737351ea9e116291112b7d576d9ed4f6bb5c2a.tar.gz
iced-76737351ea9e116291112b7d576d9ed4f6bb5c2a.tar.bz2
iced-76737351ea9e116291112b7d576d9ed4f6bb5c2a.zip
Re-export variants of `Length` and `alignment` types
Diffstat (limited to 'examples/toast')
-rw-r--r--examples/toast/src/main.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/toast/src/main.rs b/examples/toast/src/main.rs
index fd7f07c2..040c19bd 100644
--- a/examples/toast/src/main.rs
+++ b/examples/toast/src/main.rs
@@ -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,