Stop mentioning dodrio in tour example

This commit is contained in:
Héctor Ramón Jiménez 2025-03-11 02:41:45 +01:00
parent 1654c17808
commit 23cff08e46
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 33 additions and 6 deletions

1
Cargo.lock generated
View file

@ -6026,6 +6026,7 @@ dependencies = [
"console_error_panic_hook", "console_error_panic_hook",
"console_log", "console_log",
"iced", "iced",
"open",
"tracing-subscriber", "tracing-subscriber",
] ]

View file

@ -9,6 +9,8 @@ publish = false
iced.workspace = true iced.workspace = true
iced.features = ["image", "debug"] iced.features = ["image", "debug"]
open = "5"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tracing-subscriber = "0.3" tracing-subscriber = "0.3"

View file

@ -1,9 +1,11 @@
use iced::border;
use iced::widget::{Button, Column, Container, Slider}; use iced::widget::{Button, Column, Container, Slider};
use iced::widget::{ use iced::widget::{
button, center_x, center_y, checkbox, column, horizontal_space, image, button, center_x, center_y, checkbox, column, horizontal_space, image,
radio, row, scrollable, slider, text, text_input, toggler, vertical_space, radio, rich_text, row, scrollable, slider, span, text, text_input, toggler,
vertical_space,
}; };
use iced::{Center, Color, Element, Fill, Font, Pixels}; use iced::{Center, Color, Element, Fill, Font, Pixels, Theme};
pub fn main() -> iced::Result { pub fn main() -> iced::Result {
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
@ -54,6 +56,7 @@ pub enum Message {
ToggleTextInputIcon(bool), ToggleTextInputIcon(bool),
DebugToggled(bool), DebugToggled(bool),
TogglerChanged(bool), TogglerChanged(bool),
OpenTrunk,
} }
impl Tour { impl Tour {
@ -130,6 +133,9 @@ impl Tour {
Message::TogglerChanged(toggler) => { Message::TogglerChanged(toggler) => {
self.toggler = toggler; self.toggler = toggler;
} }
Message::OpenTrunk => {
let _ = open::that_in_background("https://trunkrs.dev");
}
} }
} }
@ -210,10 +216,28 @@ impl Tour {
built on top of wgpu, a graphics library supporting Vulkan, \ built on top of wgpu, a graphics library supporting Vulkan, \
Metal, DX11, and DX12.", Metal, DX11, and DX12.",
) )
.push( .push({
"Additionally, this tour can also run on WebAssembly \ let theme = Theme::default();
thanks to dodrio, an experimental VDOM library for Rust.", let palette = theme.extended_palette();
)
rich_text![
"Additionally, this tour can also run on WebAssembly ",
"by leveraging ",
span("trunk")
.color(palette.primary.base.color)
.background(palette.background.weakest.color)
.border(
border::rounded(2)
.width(1)
.color(palette.background.weak.color)
)
.padding([0, 2])
.font(Font::MONOSPACE)
.link(Message::OpenTrunk),
"."
]
.on_link_click(std::convert::identity)
})
.push( .push(
"You will need to interact with the UI in order to reach \ "You will need to interact with the UI in order to reach \
the end!", the end!",