remove state generic from a lot of things
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
use crate::prelude::*;
|
||||
|
||||
pub struct Aligned<State> {
|
||||
pub inner: WidgetHandle<State>,
|
||||
pub struct Aligned {
|
||||
pub inner: WidgetHandle,
|
||||
pub align: Align,
|
||||
}
|
||||
|
||||
impl<State: 'static> Widget<State> for Aligned<State> {
|
||||
fn draw(&mut self, painter: &mut Painter<State>) {
|
||||
impl Widget for Aligned {
|
||||
fn draw(&mut self, painter: &mut Painter) {
|
||||
let region = match self.align.tuple() {
|
||||
(Some(x), Some(y)) => painter
|
||||
.size(&self.inner)
|
||||
@@ -25,11 +25,11 @@ impl<State: 'static> Widget<State> for Aligned<State> {
|
||||
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