Replace stateful widgets with new iced_pure API
This commit is contained in:
parent
c44267b85f
commit
ff2519b1d4
142 changed files with 3631 additions and 14494 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue