learn how workspaces + proc macros work & restructure everything

This commit is contained in:
2025-12-09 01:52:45 -05:00
parent 434e3c3af7
commit e44bb8eca4
76 changed files with 610 additions and 576 deletions

17
core/src/layout/view.rs Normal file
View File

@@ -0,0 +1,17 @@
use crate::layout::{Widget, WidgetLike, WidgetRef};
use std::marker::Unsize;
pub trait WidgetView {
type Widget: Widget + ?Sized + Unsize<dyn Widget> = dyn Widget;
fn view(&self) -> &WidgetRef<Self::Widget>;
}
pub struct ViewTag;
impl<WV: WidgetView> WidgetLike<ViewTag> for WV {
type Widget = WV::Widget;
fn add(self, _ui: &mut super::Ui) -> WidgetRef<Self::Widget> {
self.view().clone()
}
}