summaryrefslogtreecommitdiffstats
path: root/native/src/overlay.rs
diff options
context:
space:
mode:
authorLibravatar Casper Storm <casper.storm@lich.io>2022-12-13 09:31:57 +0100
committerLibravatar Casper Storm <casper.storm@lich.io>2022-12-13 09:31:57 +0100
commit2e6d90f141217bad83eacd392562c13d7485881f (patch)
treebaa2c507076073aed4fd24abc9c7a7949d85c039 /native/src/overlay.rs
parentba95042fff378213f5029b2b164d79e768482a47 (diff)
parent02182eea45537c9eb5b2bddfdff822bb8a3d143d (diff)
downloadiced-2e6d90f141217bad83eacd392562c13d7485881f.tar.gz
iced-2e6d90f141217bad83eacd392562c13d7485881f.tar.bz2
iced-2e6d90f141217bad83eacd392562c13d7485881f.zip
Merge branch 'master' into feat/slider-orientation
Diffstat (limited to '')
-rw-r--r--native/src/overlay.rs34
1 files changed, 6 insertions, 28 deletions
diff --git a/native/src/overlay.rs b/native/src/overlay.rs
index 905d3389..0b05b058 100644
--- a/native/src/overlay.rs
+++ b/native/src/overlay.rs
@@ -11,7 +11,7 @@ use crate::layout;
use crate::mouse;
use crate::renderer;
use crate::widget;
-use crate::widget::tree::{self, Tree};
+use crate::widget::Tree;
use crate::{Clipboard, Layout, Point, Rectangle, Shell, Size};
/// An interactive component that can be displayed on top of other widgets.
@@ -42,31 +42,9 @@ where
cursor_position: Point,
);
- /// Returns the [`Tag`] of the [`Widget`].
- ///
- /// [`Tag`]: tree::Tag
- fn tag(&self) -> tree::Tag {
- tree::Tag::stateless()
- }
-
- /// Returns the [`State`] of the [`Widget`].
- ///
- /// [`State`]: tree::State
- fn state(&self) -> tree::State {
- tree::State::None
- }
-
- /// Returns the state [`Tree`] of the children of the [`Widget`].
- fn children(&self) -> Vec<Tree> {
- Vec::new()
- }
-
- /// Reconciliates the [`Widget`] with the provided [`Tree`].
- fn diff(&self, _tree: &mut Tree) {}
-
- /// Applies an [`Operation`] to the [`Widget`].
+ /// Applies a [`widget::Operation`] to the [`Overlay`].
fn operate(
- &self,
+ &mut self,
_layout: Layout<'_>,
_operation: &mut dyn widget::Operation<Message>,
) {
@@ -115,7 +93,7 @@ where
/// This method will generally only be used by advanced users that are
/// implementing the [`Widget`](crate::Widget) trait.
pub fn from_children<'a, Message, Renderer>(
- children: &'a [crate::Element<'_, Message, Renderer>],
+ children: &'a mut [crate::Element<'_, Message, Renderer>],
tree: &'a mut Tree,
layout: Layout<'_>,
renderer: &Renderer,
@@ -124,11 +102,11 @@ where
Renderer: crate::Renderer,
{
children
- .iter()
+ .iter_mut()
.zip(&mut tree.children)
.zip(layout.children())
.filter_map(|((child, state), layout)| {
- child.as_widget().overlay(state, layout, renderer)
+ child.as_widget_mut().overlay(state, layout, renderer)
})
.next()
}