Only provide WidthDb in [Async]Widget::size

This commit is contained in:
Joscha 2023-02-20 16:59:17 +01:00
parent 417f33cc24
commit 0573fcec77
13 changed files with 91 additions and 83 deletions

View file

@ -1,6 +1,6 @@
use async_trait::async_trait;
use crate::{AsyncWidget, Frame, Pos, Size, Widget};
use crate::{AsyncWidget, Frame, Pos, Size, Widget, WidthDb};
#[derive(Debug, Clone, Copy)]
pub struct Cursor<I> {
@ -32,11 +32,11 @@ where
{
fn size(
&self,
frame: &mut Frame,
widthdb: &mut WidthDb,
max_width: Option<u16>,
max_height: Option<u16>,
) -> Result<Size, E> {
self.inner.size(frame, max_width, max_height)
self.inner.size(widthdb, max_width, max_height)
}
fn draw(self, frame: &mut Frame) -> Result<(), E> {
@ -53,11 +53,11 @@ where
{
async fn size(
&self,
frame: &mut Frame,
widthdb: &mut WidthDb,
max_width: Option<u16>,
max_height: Option<u16>,
) -> Result<Size, E> {
self.inner.size(frame, max_width, max_height).await
self.inner.size(widthdb, max_width, max_height).await
}
async fn draw(self, frame: &mut Frame) -> Result<(), E> {