How to add a background image to a widget?

There was a similar question in April, but it has no response. So far i’ve tried doing the following:

  • Implementing a custom widget that simply “combines” two other widgets by drawing one over another: resulted in a crash due to an attempt to “downcast an empty state”. No idea what that means.
  • Doing something around iced::advanced::Overlay: wasn’t able to implement it because Widget.layout() needs a Tree and the Overlay trait doesn’t provide one.
  • Trying to follow the modal example: the “key” to the problem in this example was the iced::widget::stack! macro, which simply doesn’t exist in the latest crates.io release. I tried using the git release, but the changelog is poorly maintained and there were some substantial differences from the looks of it (even the main Sandbox trait is gone!), so this is the least attractive path to take ATM.

Is there anything else i can do to add a background image to a widget?

The simplest way is the stack widget approach, I am afraid.