Replace width and height with Widget::size

This commit is contained in:
Héctor Ramón Jiménez 2024-01-05 17:46:33 +01:00
parent 22226394f7
commit d278bfd21d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
42 changed files with 212 additions and 275 deletions

View file

@ -14,8 +14,9 @@ use crate::core::layout::{self, Layout};
use crate::core::mouse;
use crate::core::renderer;
use crate::core::widget::tree::{self, Tree};
use crate::core::{Clipboard, Element, Shell, Widget};
use crate::core::{Length, Rectangle, Size, Vector};
use crate::core::{
Clipboard, Element, Length, Rectangle, Shell, Size, Vector, Widget,
};
use crate::graphics::geometry;
use std::marker::PhantomData;
@ -119,12 +120,11 @@ where
tree::State::new(P::State::default())
}
fn width(&self) -> Length {
self.width
}
fn height(&self) -> Length {
self.height
fn size(&self) -> Size<Length> {
Size {
width: self.width,
height: self.height,
}
}
fn layout(