chore(gpui): update component gallery APIs

Use the v1.16.1 platform entry point, AlertDialog, and ID-based Sidebar constructor while preserving the gallery text, menu order, and 180px sidebar width.
This commit is contained in:
kuddev committed 2026-08-24 16:34:54 +08:00
1 parent f69ba47811
commit ee75ccfd73
2 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ use gpui_component_assets::Assets;
/// 在当前线程启动 GPUI 运行时并打开组件验收窗口,阻塞直至 UI 退出。
pub fn run_shell() {
gpui::Application::new().with_assets(Assets).run(|cx| {
gpui_platform::application().with_assets(Assets).run(|cx| {
ui::bootstrap::init(cx);
cx.activate(true);
app::open_gallery_window(cx);
+6 -6
View File
@@ -190,11 +190,11 @@ impl Render for ComponentGallery {
.outline()
.label("打开 Dialog")
.on_click(cx.listener(|_, _, window, cx| {
window.open_dialog(cx, |dialog, _, _| {
dialog.title("Nebula 组件 Dialog").alert().child(
"Dialog、焦点和 Esc 关闭行为由组件库提供。",
)
});
window.open_alert_dialog(cx, |dialog, _, _| {
dialog.title("Nebula 组件 Dialog").child(
"Dialog、焦点和 Esc 关闭行为由组件库提供。",
)
});
})),
),
)
@@ -214,7 +214,7 @@ impl Render for ComponentGallery {
h_flex()
.h(px(190.0))
.gap_3()
.child(Sidebar::left().w(px(180.0)).child(
.child(Sidebar::new("gallery-sidebar").w(px(180.0)).child(
SidebarGroup::new("Nebula").child(
SidebarMenu::new().children([
SidebarMenuItem::new("会话"),