Add components example

Re-arrange generics on mouse event handler
Add TypeTag struct for dynamically tagged components
This commit is contained in:
Mikayla 2023-08-15 03:06:43 -07:00
parent 5ce7ccac32
commit e5eed29c72
No known key found for this signature in database
49 changed files with 585 additions and 155 deletions

View file

@ -2560,7 +2560,7 @@ impl Workspace {
};
enum TitleBar {}
MouseEventHandler::<TitleBar, _>::new(0, cx, |_, cx| {
MouseEventHandler::new::<TitleBar, _>(0, cx, |_, cx| {
Stack::new()
.with_children(
self.titlebar_item
@ -2649,7 +2649,7 @@ impl Workspace {
if self.project.read(cx).is_read_only() {
enum DisconnectedOverlay {}
Some(
MouseEventHandler::<DisconnectedOverlay, _>::new(0, cx, |_, cx| {
MouseEventHandler::new::<DisconnectedOverlay, _>(0, cx, |_, cx| {
let theme = &theme::current(cx);
Label::new(
"Your connection to the remote project has been lost.",