Reorganize element-related traits
This commit is contained in:
parent
ca1d9dd0e5
commit
c23f17ee0b
42 changed files with 190 additions and 265 deletions
|
@ -1,7 +1,7 @@
|
|||
use crate::{h_stack, prelude::*, Icon, IconElement};
|
||||
use gpui::{prelude::*, Action, AnyView, Div, MouseButton, MouseDownEvent, Stateful};
|
||||
|
||||
#[derive(RenderOnce)]
|
||||
#[derive(IntoElement)]
|
||||
pub struct IconButton {
|
||||
id: ElementId,
|
||||
icon: Icon,
|
||||
|
@ -13,7 +13,7 @@ pub struct IconButton {
|
|||
on_mouse_down: Option<Box<dyn Fn(&MouseDownEvent, &mut WindowContext) + 'static>>,
|
||||
}
|
||||
|
||||
impl Component for IconButton {
|
||||
impl RenderOnce for IconButton {
|
||||
type Rendered = Stateful<Div>;
|
||||
|
||||
fn render(self, cx: &mut WindowContext) -> Self::Rendered {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue