Only provide WidthDb in [Async]Widget::size
This commit is contained in:
parent
417f33cc24
commit
0573fcec77
13 changed files with 91 additions and 83 deletions
|
|
@ -3,14 +3,14 @@ use async_trait::async_trait;
|
|||
use crate::widgets::{
|
||||
Background, Border, Either2, Either3, Float, JoinSegment, Layer, Padding, Resize,
|
||||
};
|
||||
use crate::{Frame, Size};
|
||||
use crate::{Frame, Size, WidthDb};
|
||||
|
||||
// TODO Feature-gate these traits
|
||||
|
||||
pub trait Widget<E> {
|
||||
fn size(
|
||||
&self,
|
||||
frame: &mut Frame,
|
||||
widthdb: &mut WidthDb,
|
||||
max_width: Option<u16>,
|
||||
max_height: Option<u16>,
|
||||
) -> Result<Size, E>;
|
||||
|
|
@ -22,7 +22,7 @@ pub trait Widget<E> {
|
|||
pub trait AsyncWidget<E> {
|
||||
async fn size(
|
||||
&self,
|
||||
frame: &mut Frame,
|
||||
widthdb: &mut WidthDb,
|
||||
max_width: Option<u16>,
|
||||
max_height: Option<u16>,
|
||||
) -> Result<Size, E>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue