diff options
author | 2024-03-03 01:02:23 +0100 | |
---|---|---|
committer | 2024-03-03 01:08:11 +0100 | |
commit | cbe4603579c6af55c35254257981e14cd4a67897 (patch) | |
tree | 23fa181e9a5a8aad983d9e623e14fa8524592691 /examples/layout | |
parent | af9fb367f361a564aa2a9fc11333816566eb5d55 (diff) | |
download | iced-cbe4603579c6af55c35254257981e14cd4a67897.tar.gz iced-cbe4603579c6af55c35254257981e14cd4a67897.tar.bz2 iced-cbe4603579c6af55c35254257981e14cd4a67897.zip |
Remove complex cross-axis layout logic from `Column` and `Row`
Diffstat (limited to 'examples/layout')
-rw-r--r-- | examples/layout/src/main.rs | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/examples/layout/src/main.rs b/examples/layout/src/main.rs index 06a476be..39c8315f 100644 --- a/examples/layout/src/main.rs +++ b/examples/layout/src/main.rs @@ -4,11 +4,11 @@ use iced::mouse; use iced::theme; use iced::widget::{ button, canvas, checkbox, column, container, horizontal_space, pick_list, - row, scrollable, text, vertical_rule, + row, scrollable, text, }; use iced::{ - color, Alignment, Application, Color, Command, Element, Font, Length, - Point, Rectangle, Renderer, Settings, Subscription, Theme, + color, Alignment, Application, Command, Element, Font, Length, Point, + Rectangle, Renderer, Settings, Subscription, Theme, }; pub fn main() -> iced::Result { @@ -167,10 +167,6 @@ impl Example { title: "Application", view: application, }, - Self { - title: "Nested Quotes", - view: nested_quotes, - }, ]; fn is_first(self) -> bool { @@ -304,38 +300,6 @@ fn application<'a>() -> Element<'a, Message> { column![header, row![sidebar, content]].into() } -fn nested_quotes<'a>() -> Element<'a, Message> { - (1..5) - .fold(column![text("Original text")].padding(10), |quotes, i| { - column![ - container( - row![vertical_rule(2), quotes].height(Length::Shrink) - ) - .style(|theme: &Theme| { - let palette = theme.extended_palette(); - - container::Appearance::default().with_background( - if palette.is_dark { - Color { - a: 0.01, - ..Color::WHITE - } - } else { - Color { - a: 0.08, - ..Color::BLACK - } - }, - ) - }), - text(format!("Reply {i}")) - ] - .spacing(10) - .padding(10) - }) - .into() -} - fn square<'a>(size: impl Into<Length> + Copy) -> Element<'a, Message> { struct Square; |