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
@@ -7,7 +7,7 @@ use ely_gpui_component::{
|
||||
};
|
||||
use gpui::{App, Div, IntoElement, ParentElement, Styled, Window, div, px};
|
||||
|
||||
use crate::ui::{code, row, section, specimen, specimens};
|
||||
use crate::ui::{code, row, section, specimen, specimens, web_note};
|
||||
|
||||
/// A window drawn inside the page.
|
||||
pub fn window_frame(width: f32, height: f32, cx: &App) -> Div {
|
||||
@@ -116,6 +116,10 @@ pub fn window_controls(cx: &App) -> impl IntoElement + use<> {
|
||||
"Minimize and zoom act on this window. Close here only logs.",
|
||||
cx,
|
||||
))
|
||||
.children(web_note(
|
||||
"A browser owns the page's window: gpui on the web only logs minimize and zoom.",
|
||||
cx,
|
||||
))
|
||||
}
|
||||
|
||||
pub fn drag_area(window: &mut Window, cx: &mut App) -> impl IntoElement + use<> {
|
||||
@@ -142,6 +146,10 @@ pub fn drag_area(window: &mut Window, cx: &mut App) -> impl IntoElement + use<>
|
||||
.child("Double-click to zoom this window"),
|
||||
)
|
||||
.child(code("drag_region(id, window, cx)", cx))
|
||||
.children(web_note(
|
||||
"A browser owns the page's window: gpui on the web neither moves nor zooms it.",
|
||||
cx,
|
||||
))
|
||||
}
|
||||
|
||||
pub fn resize_border(cx: &App) -> impl IntoElement + use<> {
|
||||
@@ -154,6 +162,10 @@ pub fn resize_border(cx: &App) -> impl IntoElement + use<> {
|
||||
"Linux draws its own edges. This macOS window keeps the system's, so the border lays out only.",
|
||||
))
|
||||
.child(code("ResizeBorder::new().child(app)", cx))
|
||||
.children(web_note(
|
||||
"A browser sizes the page's canvas itself: gpui on the web resizes no window from its edges.",
|
||||
cx,
|
||||
))
|
||||
}
|
||||
|
||||
pub fn menus(cx: &App) -> impl IntoElement + use<> {
|
||||
@@ -177,4 +189,8 @@ pub fn menus(cx: &App) -> impl IntoElement + use<> {
|
||||
.child(Caption::new(
|
||||
"MenuBar draws the same menus inside the window. It lands with Menus, chapter 8.",
|
||||
))
|
||||
.children(web_note(
|
||||
"A browser page has no menu bar and no Dock: gpui on the web keeps neither cx.set_menus nor cx.set_dock_menu.",
|
||||
cx,
|
||||
))
|
||||
}
|
||||
Reference in new issue
Block a user