summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Nicolas Levy <nicolaspierrelevy@gmail.com>2021-03-14 23:39:01 +0100
committerLibravatar GitHub <noreply@github.com>2021-03-14 23:39:01 +0100
commit0333a8daff6db989adc6035a4c09df171a86f6fe (patch)
treed35f52adf8cc10db2be2cd27d629f38de3bae41f
parentc1f70f1e9252b1971c17cd385273460c669fac26 (diff)
downloadiced-0333a8daff6db989adc6035a4c09df171a86f6fe.tar.gz
iced-0333a8daff6db989adc6035a4c09df171a86f6fe.tar.bz2
iced-0333a8daff6db989adc6035a4c09df171a86f6fe.zip
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
-rw-r--r--native/src/widget/button.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs
index 59d6e219..99e98fd1 100644
--- a/native/src/widget/button.rs
+++ b/native/src/widget/button.rs
@@ -4,6 +4,7 @@
use crate::event::{self, Event};
use crate::layout;
use crate::mouse;
+use crate::overlay;
use crate::touch;
use crate::{
Clipboard, Element, Hasher, Layout, Length, Point, Rectangle, Widget,
@@ -240,6 +241,13 @@ where
self.width.hash(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`].