diff options
author | 2020-03-31 17:48:41 +0200 | |
---|---|---|
committer | 2020-03-31 17:48:41 +0200 | |
commit | 327347501c78a1c8e55a39fe1b5d54d7c2fcbcab (patch) | |
tree | 3100782d2dfb19dea456402d6615ec340e97d9b7 /examples | |
parent | 291dc728a42c6e888ca6d97eea0f3308591b15a5 (diff) | |
parent | 990b4aa0b75d069c08e5f4018f9430a70a394eb7 (diff) | |
download | iced-327347501c78a1c8e55a39fe1b5d54d7c2fcbcab.tar.gz iced-327347501c78a1c8e55a39fe1b5d54d7c2fcbcab.tar.bz2 iced-327347501c78a1c8e55a39fe1b5d54d7c2fcbcab.zip |
Merge pull request #248 from hecrj/feature/container-padding
Implement `padding` support for `Container`
Diffstat (limited to 'examples')
-rw-r--r-- | examples/clock/src/main.rs | 1 | ||||
-rw-r--r-- | examples/pane_grid/src/main.rs | 6 | ||||
-rw-r--r-- | examples/pokedex/src/main.rs | 2 | ||||
-rw-r--r-- | examples/svg/src/main.rs | 21 |
4 files changed, 15 insertions, 15 deletions
diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs index d8266f06..62acb457 100644 --- a/examples/clock/src/main.rs +++ b/examples/clock/src/main.rs @@ -66,6 +66,7 @@ impl Application for Clock { Container::new(canvas) .width(Length::Fill) .height(Length::Fill) + .padding(20) .center_x() .center_y() .into() diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index dafc396c..b4bbd68f 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -106,11 +106,10 @@ impl Sandbox for Example { .on_resize(Message::Resized) .on_key_press(handle_hotkey); - Column::new() + Container::new(pane_grid) .width(Length::Fill) .height(Length::Fill) .padding(10) - .push(pane_grid) .into() } } @@ -213,9 +212,10 @@ impl Content { .push(Text::new(format!("Pane {}", id)).size(30)) .push(controls); - Container::new(Column::new().padding(5).push(content)) + Container::new(content) .width(Length::Fill) .height(Length::Fill) + .padding(5) .center_y() .style(style::Pane { is_focused: focus.is_some(), diff --git a/examples/pokedex/src/main.rs b/examples/pokedex/src/main.rs index 4449b901..aec05287 100644 --- a/examples/pokedex/src/main.rs +++ b/examples/pokedex/src/main.rs @@ -225,7 +225,7 @@ enum Error { impl From<reqwest::Error> for Error { fn from(error: reqwest::Error) -> Error { - dbg!(&error); + dbg!(error); Error::APIError } diff --git a/examples/svg/src/main.rs b/examples/svg/src/main.rs index 80e28cf8..e19eeca2 100644 --- a/examples/svg/src/main.rs +++ b/examples/svg/src/main.rs @@ -1,4 +1,4 @@ -use iced::{Column, Container, Element, Length, Sandbox, Settings, Svg}; +use iced::{Container, Element, Length, Sandbox, Settings, Svg}; pub fn main() { Tiger::run(Settings::default()) @@ -20,18 +20,17 @@ impl Sandbox for Tiger { fn update(&mut self, _message: ()) {} fn view(&mut self) -> Element<()> { - let content = Column::new().padding(20).push( - Svg::from_path(format!( - "{}/resources/tiger.svg", - env!("CARGO_MANIFEST_DIR") - )) - .width(Length::Fill) - .height(Length::Fill), - ); - - Container::new(content) + let svg = Svg::from_path(format!( + "{}/resources/tiger.svg", + env!("CARGO_MANIFEST_DIR") + )) + .width(Length::Fill) + .height(Length::Fill); + + Container::new(svg) .width(Length::Fill) .height(Length::Fill) + .padding(20) .center_x() .center_y() .into() |