Replace stateful widgets with new iced_pure API

This commit is contained in:
Héctor Ramón Jiménez 2022-07-27 06:49:20 +02:00
parent c44267b85f
commit ff2519b1d4
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
142 changed files with 3631 additions and 14494 deletions

View file

@ -1,4 +1,5 @@
use iced::{Container, Element, Length, Sandbox, Settings, Svg};
use iced::widget::{container, svg};
use iced::{Element, Length, Sandbox, Settings};
pub fn main() -> iced::Result {
Tiger::run(Settings::default())
@ -19,15 +20,15 @@ impl Sandbox for Tiger {
fn update(&mut self, _message: ()) {}
fn view(&mut self) -> Element<()> {
let svg = Svg::from_path(format!(
fn view(&self) -> Element<()> {
let svg = svg(svg::Handle::from_path(format!(
"{}/resources/tiger.svg",
env!("CARGO_MANIFEST_DIR")
))
)))
.width(Length::Fill)
.height(Length::Fill);
Container::new(svg)
container(svg)
.width(Length::Fill)
.height(Length::Fill)
.padding(20)