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

View File

@@ -0,0 +1,23 @@
use crate::prelude::*;
pub struct LayerOffset {
pub inner: WidgetRef,
pub offset: usize,
}
impl Widget for LayerOffset {
fn draw(&mut self, painter: &mut Painter) {
for _ in 0..self.offset {
painter.next_layer();
}
painter.widget(&self.inner);
}
fn desired_width(&mut self, ctx: &mut SizeCtx) -> Len {
ctx.width(&self.inner)
}
fn desired_height(&mut self, ctx: &mut SizeCtx) -> Len {
ctx.height(&self.inner)
}
}