T01 primitives: image, divider, backdrop, focus, pressable, measure, tooltip

Ely-built primitives plus gallery demos for every chapter-one entry,
including gpui natives. The gallery now scripts real input by posting
NSEvents to its own queue and shoots each interaction in both modes.
Codex gpt-6-astra (max): three rounds; the last finding, a two-line
doc comment, was fixed after the three-review cap.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-25 00:39:06 -04:00
1 parent abf4cbcfc6
commit a13343c2a5
38 files changed
+2165 -157

No files matched your search

+12 -9
View File
@@ -7,18 +7,21 @@ pub mod theme;
pub use assets::Assets;
use gpui::App;
use gpui::{App, KeyBinding};
use crate::primitives::IconName;
use crate::primitives::{FocusNext, FocusPrev, IconName};
/// Loads fonts and the theme. Call once, first.
/// Loads fonts and the theme, binds Tab. Call once, first.
pub fn init(cx: &mut App) {
let probe = IconName::Check.path();
let wired = cx.asset_source().load(probe).ok().flatten().is_some();
assert!(
wired,
"ely: pass `ely_gpui_component::Assets` to `Application::with_assets`"
);
match cx.asset_source().load(IconName::Check.path()) {
Ok(Some(_)) => {}
Ok(None) => panic!("ely: pass `ely_gpui_component::Assets` to `Application::with_assets`"),
Err(error) => panic!("ely: asset source failed: {error:#}"),
}
assets::load_fonts(cx).expect("ely: embedded fonts failed to register");
theme::Theme::init(cx);
cx.bind_keys([
KeyBinding::new("tab", FocusNext, None),
KeyBinding::new("shift-tab", FocusPrev, None),
]);
}