Add module documentation to GPUI and make gpui.rs example compile

This commit is contained in:
Mikayla
2024-01-23 21:29:12 -08:00
parent c07e416dc0
commit d80959d64e
4 changed files with 60 additions and 26 deletions
-7
View File
@@ -14,13 +14,6 @@
//! as several associated traits. Together, these provide the full suite of Dom-like events
//! and Tailwind-like styling that you can use to build your own custom elements. Div is
//! constructed by combining these two systems into an all-in-one element.
//!
//! # Capturing and bubbling
//!
//! Note that while event dispatch in GPUI uses similar names and concepts to the web
//! even API, the details are very different. See the documentation in [TODO!(docs)
//! DOCUMENT EVENT DISPATCH SOMEWHERE IN WINDOW CONTEXT] for more details
//!
use crate::{
point, px, size, Action, AnyDrag, AnyElement, AnyTooltip, AnyView, AppContext, Bounds,
+12
View File
@@ -46,6 +46,18 @@ impl IntoElement for &'static str {
}
}
impl IntoElement for String {
type Element = SharedString;
fn element_id(&self) -> Option<ElementId> {
None
}
fn into_element(self) -> Self::Element {
self.into()
}
}
impl Element for SharedString {
type State = TextState;