Overwrite overlay
method in Widget implementation for Button (#764)
* Overwrite `overlay` method in Widget implementation for Button * Overwrite `overlay` method in Widget implementation for Button (cargo fmt) * Fix button overlay
This commit is contained in:
parent
c1f70f1e92
commit
0333a8daff
@ -4,6 +4,7 @@
|
|||||||
use crate::event::{self, Event};
|
use crate::event::{self, Event};
|
||||||
use crate::layout;
|
use crate::layout;
|
||||||
use crate::mouse;
|
use crate::mouse;
|
||||||
|
use crate::overlay;
|
||||||
use crate::touch;
|
use crate::touch;
|
||||||
use crate::{
|
use crate::{
|
||||||
Clipboard, Element, Hasher, Layout, Length, Point, Rectangle, Widget,
|
Clipboard, Element, Hasher, Layout, Length, Point, Rectangle, Widget,
|
||||||
@ -240,6 +241,13 @@ where
|
|||||||
self.width.hash(state);
|
self.width.hash(state);
|
||||||
self.content.hash_layout(state);
|
self.content.hash_layout(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn overlay(
|
||||||
|
&mut self,
|
||||||
|
layout: Layout<'_>,
|
||||||
|
) -> Option<overlay::Element<'_, Message, Renderer>> {
|
||||||
|
self.content.overlay(layout.children().next().unwrap())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The renderer of a [`Button`].
|
/// The renderer of a [`Button`].
|
||||||
|
Loading…
Reference in New Issue
Block a user