Merge branch 'master' into improvement/docs
This commit is contained in:
commit
428509c84a
@ -255,6 +255,14 @@ where
|
|||||||
A: Clone,
|
A: Clone,
|
||||||
Renderer: crate::Renderer,
|
Renderer: crate::Renderer,
|
||||||
{
|
{
|
||||||
|
fn width(&self) -> Length {
|
||||||
|
self.widget.width()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
self.widget.height()
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
@ -320,6 +328,14 @@ impl<'a, Message, Renderer> Widget<Message, Renderer>
|
|||||||
where
|
where
|
||||||
Renderer: crate::Renderer + renderer::Debugger,
|
Renderer: crate::Renderer + renderer::Debugger,
|
||||||
{
|
{
|
||||||
|
fn width(&self) -> Length {
|
||||||
|
self.element.widget.width()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
self.element.widget.height()
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -69,6 +69,10 @@ pub trait Widget<Message, Renderer>
|
|||||||
where
|
where
|
||||||
Renderer: crate::Renderer,
|
Renderer: crate::Renderer,
|
||||||
{
|
{
|
||||||
|
fn width(&self) -> Length;
|
||||||
|
|
||||||
|
fn height(&self) -> Length;
|
||||||
|
|
||||||
/// Returns the [`Node`] of the [`Widget`].
|
/// Returns the [`Node`] of the [`Widget`].
|
||||||
///
|
///
|
||||||
/// This [`Node`] is used by the runtime to compute the [`Layout`] of the
|
/// This [`Node`] is used by the runtime to compute the [`Layout`] of the
|
||||||
@ -83,14 +87,6 @@ where
|
|||||||
limits: &layout::Limits,
|
limits: &layout::Limits,
|
||||||
) -> layout::Node;
|
) -> layout::Node;
|
||||||
|
|
||||||
fn width(&self) -> Length {
|
|
||||||
Length::Shrink
|
|
||||||
}
|
|
||||||
|
|
||||||
fn height(&self) -> Length {
|
|
||||||
Length::Shrink
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Draws the [`Widget`] using the associated `Renderer`.
|
/// Draws the [`Widget`] using the associated `Renderer`.
|
||||||
///
|
///
|
||||||
/// [`Widget`]: trait.Widget.html
|
/// [`Widget`]: trait.Widget.html
|
||||||
|
@ -119,6 +119,14 @@ where
|
|||||||
Renderer: self::Renderer,
|
Renderer: self::Renderer,
|
||||||
Message: Clone,
|
Message: Clone,
|
||||||
{
|
{
|
||||||
|
fn width(&self) -> Length {
|
||||||
|
self.width
|
||||||
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
Length::Shrink
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -72,6 +72,10 @@ where
|
|||||||
Length::Fill
|
Length::Fill
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
Length::Shrink
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -118,6 +118,10 @@ where
|
|||||||
self.width
|
self.width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
self.height
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -99,6 +99,10 @@ where
|
|||||||
self.width
|
self.width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
self.height
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -58,6 +58,14 @@ impl<Message, Renderer> Widget<Message, Renderer> for Image
|
|||||||
where
|
where
|
||||||
Renderer: self::Renderer,
|
Renderer: self::Renderer,
|
||||||
{
|
{
|
||||||
|
fn width(&self) -> Length {
|
||||||
|
self.width
|
||||||
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
self.height
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -82,6 +82,10 @@ where
|
|||||||
Length::Fill
|
Length::Fill
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
Length::Shrink
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -120,6 +120,10 @@ where
|
|||||||
self.width
|
self.width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
self.height
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -105,6 +105,14 @@ impl<'a, Message, Renderer> Widget<Message, Renderer>
|
|||||||
where
|
where
|
||||||
Renderer: self::Renderer + column::Renderer,
|
Renderer: self::Renderer + column::Renderer,
|
||||||
{
|
{
|
||||||
|
fn width(&self) -> Length {
|
||||||
|
Length::Fill
|
||||||
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
self.height
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -86,6 +86,10 @@ where
|
|||||||
self.width
|
self.width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
Length::Shrink
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -117,6 +117,10 @@ where
|
|||||||
self.width
|
self.width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
self.height
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
@ -100,6 +100,10 @@ where
|
|||||||
self.width
|
self.width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn height(&self) -> Length {
|
||||||
|
Length::Shrink
|
||||||
|
}
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
Loading…
Reference in New Issue
Block a user