tag: Implement styled for custom style (#1319)

This commit is contained in:
Floyd Wang 2025-10-02 14:07:07 +08:00 committed by GitHub
parent 8c6cde3719
commit df8bcefaaa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -215,11 +215,19 @@ impl Sizable for Tag {
self self
} }
} }
impl ParentElement for Tag { impl ParentElement for Tag {
fn extend(&mut self, elements: impl IntoIterator<Item = AnyElement>) { fn extend(&mut self, elements: impl IntoIterator<Item = AnyElement>) {
self.children.extend(elements); self.children.extend(elements);
} }
} }
impl Styled for Tag {
fn style(&mut self) -> &mut StyleRefinement {
&mut self.style
}
}
impl RenderOnce for Tag { impl RenderOnce for Tag {
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement { fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
let bg = if self.outline { let bg = if self.outline {