T44d Web · Gallery builds for wasm32: one story per section by URL, themed by the host
The gallery's entry runs natively or, on wasm32, from a wasm_bindgen start through gpui_web, single-threaded with WebGL2 fallback. ?page, ?story and ?theme choose what shows; an unknown one fails in the page and the log. set_theme switches the mode later. Pictures load from ELY_GALLERY_ASSETS. scripts/stories.py writes examples/gallery/stories.json from the pages.
This commit is contained in:
83 files changed
+1000
-455
No files matched your search
@@ -12,6 +12,7 @@ pub struct Probes(HashMap<&'static str, Bounds<Pixels>>);
|
||||
impl Global for Probes {}
|
||||
|
||||
impl Probes {
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
pub fn get(key: &str, cx: &App) -> Option<Bounds<Pixels>> {
|
||||
cx.try_global::<Probes>()
|
||||
.and_then(|probes| probes.0.get(key).copied())
|
||||
@@ -39,10 +40,12 @@ impl Opened {
|
||||
cx.default_global::<Opened>().0.insert(key, handle);
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
pub fn take(key: &str, cx: &mut App) -> Option<AnyWindowHandle> {
|
||||
cx.default_global::<Opened>().0.remove(key)
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
pub fn get(key: &str, cx: &App) -> Option<AnyWindowHandle> {
|
||||
cx.try_global::<Opened>()
|
||||
.and_then(|opened| opened.0.get(key).copied())
|
||||
|
||||
Reference in new issue
Block a user