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:
38 files changed
+2165
-157
No files matched your search
+12
-9
@@ -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),
|
||||
]);
|
||||
}
|
||||
Reference in new issue
Block a user