add avatar

This commit is contained in:
2026-10-28 20:21:59 +07:00
parent 9626391403
commit 3fb431a0b8
4 changed files with 345 additions and 0 deletions
+27
View File
@@ -4,6 +4,7 @@ use gpui::{
ParentElement as _, Render, SharedString, StatefulInteractiveElement as _, Styled as _, Window,
WindowBounds, WindowOptions, div, px, size,
};
use gpui_native_core::avatar::Avatar;
use gpui_native_core::button::{Button, ButtonVariant};
use gpui_native_core::checkbox::Checkbox;
use gpui_native_core::common::{h_flex, v_flex};
@@ -409,6 +410,32 @@ impl Render for Gallery {
.accessibility_label("Working"),
),
)
.child(
div()
.flex()
.flex_col()
.gap_2()
.child(section_label(
"avatar · native refs — NSImage (contact), WinUI PersonPicture, Adwaita Avatar, Breeze",
colors,
))
.child(
h_flex()
.gap_3()
.child(
Avatar::new("reya@reya.info")
.name("Reya Adele")
.picture(Some("https://github.com/reya.png")),
)
.child(
Avatar::new("ada@reya.info")
.name("Ada Lovelace")
.picture(Some("https://example.com/missing.png")),
)
.child(Avatar::new("grace@reya.info").name("Grace Hopper"))
.child(Avatar::new("bot@reya.info")),
),
)
.child(
div()
.flex()