T44d Web · What a browser cannot do says why; fonts resolve; the bundle builds
Demos that open a second window, take files, move the window, read the clipboard or set native menus show a note on the web in the blocked style. IBM Plex Sans Regular joins the assets, unmodified, where gpui's svg renderer loads it: gpui_web answers .SystemUIFont with it. The gallery's web entry registers a Hebrew cut of Noto Sans Hebrew. scripts/web.sh builds the bundle with wasm-bindgen and wasm-opt -Oz, 20.0 MB, and fails past 25 MiB.
This commit is contained in:
1 parent
48c7b09d8d
commit
2cd2ca8bc1
26 files changed
+381
-76
No files matched your search
@@ -4,7 +4,7 @@ use ely_gpui_component::{
|
||||
};
|
||||
use gpui::{App, IntoElement, ParentElement, SharedString, Styled, Window, div, px};
|
||||
|
||||
use crate::ui::{change, keep, section, specimen, specimens};
|
||||
use crate::ui::{NO_FILES, change, keep, section, specimen, specimens, web_note};
|
||||
|
||||
/// Which code palette the demo last chose.
|
||||
struct Chosen(SharedString);
|
||||
@@ -17,6 +17,7 @@ pub fn importing(window: &mut Window, cx: &mut App) -> impl IntoElement + use<>
|
||||
"A VS Code color theme dropped here reads into Ely's palette, the colors it leaves out kept from Ely's; Apply sets it on the whole gallery. Code palettes choose the colors of code for the mode shown.",
|
||||
cx,
|
||||
)
|
||||
.children(web_note(NO_FILES, cx))
|
||||
.child(
|
||||
specimens()
|
||||
.child(specimen(
|
||||
|
||||
@@ -14,7 +14,7 @@ use gpui::{
|
||||
|
||||
use crate::{
|
||||
probe::{Opened, probe},
|
||||
ui::{change, keep, section, specimen, specimens},
|
||||
ui::{change, keep, native_only, section, specimen, specimens},
|
||||
};
|
||||
|
||||
const PLATFORMS: [(Platform, &str); 3] = [
|
||||
@@ -38,10 +38,14 @@ pub fn platform(window: &mut Window, cx: &mut App) -> impl IntoElement + use<> {
|
||||
.child(specimen("IconTheme", icons(window, cx), cx))
|
||||
.child(specimen(
|
||||
"Vibrancy",
|
||||
probe(
|
||||
"frosted-open",
|
||||
Button::new("frosted-open", "Open a frosted window")
|
||||
.on_click(|_, _, cx| frosted(cx)),
|
||||
native_only(
|
||||
probe(
|
||||
"frosted-open",
|
||||
Button::new("frosted-open", "Open a frosted window")
|
||||
.on_click(|_, _, cx| frosted(cx)),
|
||||
),
|
||||
"A browser page is a single window, and gpui leaves what lies behind it to the browser, so no frosted window opens and nothing blurs through.",
|
||||
cx,
|
||||
),
|
||||
cx,
|
||||
)),
|
||||
@@ -141,10 +145,10 @@ fn frosted(cx: &mut App) {
|
||||
window_background: WindowBackgroundAppearance::Blurred,
|
||||
..Default::default()
|
||||
};
|
||||
let handle = cx
|
||||
.open_window(options, |_, cx| cx.new(|_| Frosted))
|
||||
.expect("the frosted window opens");
|
||||
Opened::insert("frosted", handle.into(), cx);
|
||||
match cx.open_window(options, |_, cx| cx.new(|_| Frosted)) {
|
||||
Ok(handle) => Opened::insert("frosted", handle.into(), cx),
|
||||
Err(error) => log::error!("gallery: frosted window failed: {error:#}"),
|
||||
}
|
||||
}
|
||||
|
||||
/// A window whose sidebar lets the desktop through.
|
||||
|
||||
Reference in new issue
Block a user