Merge branch 'master' into explicit-text-caching

This commit is contained in:
Héctor Ramón Jiménez 2023-09-10 00:34:21 +02:00
commit b8e5693a30
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
178 changed files with 1768 additions and 1388 deletions

View file

@ -6,5 +6,15 @@ edition = "2021"
publish = false
[dependencies]
iced = { path = "../..", features = ["image", "debug"] }
env_logger = "0.10.0"
iced.workspace = true
iced.features = ["image", "debug"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tracing-subscriber = "0.3"
[target.'cfg(target_arch = "wasm32")'.dependencies]
iced.workspace = true
iced.features = ["image", "debug", "webgl"]
console_error_panic_hook = "0.1"
console_log = "1.0"

View file

@ -5,8 +5,8 @@ A simple UI tour that can run both on native platforms and the web! It showcases
The __[`main`]__ file contains all the code of the example! All the cross-platform GUI is defined in terms of __state__, __messages__, __update logic__ and __view logic__.
<div align="center">
<a href="https://gfycat.com/politeadorableiberianmole">
<img src="https://thumbs.gfycat.com/PoliteAdorableIberianmole-small.gif">
<a href="https://iced.rs/examples/tour.mp4">
<img src="https://iced.rs/examples/tour.gif">
</a>
</div>

View file

@ -8,7 +8,14 @@ use iced::widget::{Button, Column, Container, Slider};
use iced::{Color, Element, Font, Length, Pixels, Renderer, Sandbox, Settings};
pub fn main() -> iced::Result {
env_logger::init();
#[cfg(target_arch = "wasm32")]
{
console_log::init().expect("Initialize logger");
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
}
#[cfg(not(target_arch = "wasm32"))]
tracing_subscriber::fmt::init();
Tour::run(Settings::default())
}