Skip to content

Commit

Permalink
fix: component
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Aug 26, 2024
1 parent d6db255 commit 9f9e3b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/component/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ publish = false

[dependencies]
iced.workspace = true
iced.features = ["debug", "lazy"]
iced.features = ["debug", "lazy", "winit", "tiny-skia"]
16 changes: 7 additions & 9 deletions widget/src/lazy/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,6 @@ where
overlay: Some(overlay),
})))
}
fn id(&self) -> Option<iced_runtime::core::id::Id> {
self.with_element(|element| element.as_widget().id())
}

fn set_id(&mut self, _id: iced_runtime::core::id::Id) {
self.with_element_mut(|element| element.as_widget_mut().set_id(_id));
}

#[cfg(feature = "a11y")]
fn a11y_nodes(
Expand All @@ -498,14 +491,19 @@ where

fn drag_destinations(
&self,
state: &Tree,
tree: &Tree,
layout: Layout<'_>,
renderer: &Renderer,
dnd_rectangles: &mut core::clipboard::DndDestinationRectangles,
) {
let mut tree = tree
.state
.downcast_ref::<Rc<RefCell<Option<Tree>>>>()
.borrow_mut();
let mut tree = tree.as_ref().unwrap();
self.with_element(|element| {
element.as_widget().drag_destinations(
&state.children[0],
&tree.children[0],
layout,
renderer,
dnd_rectangles,
Expand Down

0 comments on commit 9f9e3b4

Please sign in to comment.