Revert "Add a proc macro for deriving override structs with optional fields"
This reverts commit ab9356e9d8
.
This commit is contained in:
parent
ab9356e9d8
commit
f3a275d339
9 changed files with 96 additions and 209 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::element::{Element, ElementMetadata, IntoElement};
|
||||
use crate::element::{Element, ElementMetadata, EventHandler, IntoElement};
|
||||
use gpui::{geometry::Size, text_layout::LineLayout, RenderContext};
|
||||
use parking_lot::Mutex;
|
||||
use std::sync::Arc;
|
||||
|
@ -22,8 +22,8 @@ pub struct Text<V> {
|
|||
impl<V: 'static> Element<V> for Text<V> {
|
||||
type Layout = Arc<Mutex<Option<TextLayout>>>;
|
||||
|
||||
fn metadata(&mut self) -> &mut crate::element::ElementMetadata<V> {
|
||||
&mut self.metadata
|
||||
fn style_mut(&mut self) -> &mut crate::style::ElementStyle {
|
||||
&mut self.metadata.style
|
||||
}
|
||||
|
||||
fn layout(
|
||||
|
@ -91,6 +91,10 @@ impl<V: 'static> Element<V> for Text<V> {
|
|||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handlers_mut(&mut self) -> &mut Vec<EventHandler<V>> {
|
||||
&mut self.metadata.handlers
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TextLayout {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue