remove state generic from a lot of things

This commit is contained in:
iris committed 2025-12-17 21:37:55 -05:00
1 parent 7e6369029f
commit 30bc55c78e
45 files changed
+740 -856

No files matched your search

+6 -6
View File
@@ -1,16 +1,16 @@
use crate::prelude::*;
pub struct Pad<State> {
pub struct Pad {
pub padding: Padding,
pub inner: WidgetHandle<State>,
pub inner: WidgetHandle,
}
impl<State: 'static> Widget<State> for Pad<State> {
fn draw(&mut self, painter: &mut Painter<State>) {
impl Widget for Pad {
fn draw(&mut self, painter: &mut Painter) {
painter.widget_within(&self.inner, self.padding.region());
}
fn desired_width(&mut self, ctx: &mut SizeCtx<State>) -> Len {
fn desired_width(&mut self, ctx: &mut SizeCtx) -> Len {
let width = self.padding.left + self.padding.right;
let height = self.padding.top + self.padding.bottom;
ctx.outer.x.abs -= width;
@@ -20,7 +20,7 @@ impl<State: 'static> Widget<State> for Pad<State> {
size
}
fn desired_height(&mut self, ctx: &mut SizeCtx<State>) -> Len {
fn desired_height(&mut self, ctx: &mut SizeCtx) -> Len {
let width = self.padding.left + self.padding.right;
let height = self.padding.top + self.padding.bottom;
ctx.outer.x.abs -= width;