remove state generic from a lot of things
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
use crate::prelude::*;
|
||||
|
||||
pub struct Offset<State> {
|
||||
pub inner: WidgetHandle<State>,
|
||||
pub struct Offset {
|
||||
pub inner: WidgetHandle,
|
||||
pub amt: UiVec2,
|
||||
}
|
||||
|
||||
impl<State: 'static> Widget<State> for Offset<State> {
|
||||
fn draw(&mut self, painter: &mut Painter<State>) {
|
||||
impl Widget for Offset {
|
||||
fn draw(&mut self, painter: &mut Painter) {
|
||||
let region = UiRegion::FULL.offset(self.amt);
|
||||
painter.widget_within(&self.inner, region);
|
||||
}
|
||||
|
||||
fn desired_width(&mut self, ctx: &mut SizeCtx<State>) -> Len {
|
||||
fn desired_width(&mut self, ctx: &mut SizeCtx) -> Len {
|
||||
ctx.width(&self.inner)
|
||||
}
|
||||
|
||||
fn desired_height(&mut self, ctx: &mut SizeCtx<State>) -> Len {
|
||||
fn desired_height(&mut self, ctx: &mut SizeCtx) -> Len {
|
||||
ctx.height(&self.inner)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user