linebender / druid-widget-nursery

A place where Druid widgets come to mature before moving to the Druid repo.
Apache License 2.0
88 stars 41 forks source link

FlexTable example does not work #123

Closed ItsBenyaamin closed 2 years ago

ItsBenyaamin commented 2 years ago

Hi, FlexTable example doesn't work And why have these widgets not moved to druid repo? are they not complete?

the trait bound `Align<_>: druid::widget::widget::Widget<_>` is not satisfied
the following other types implement trait `druid::widget::widget::Widget<T>`:
  <AdvancedSlider as druid::widget::widget::Widget<f64>>
  <Box<(dyn PrismWidget<T> + 'static)> as druid::widget::widget::Widget<T>>
  <Box<(dyn druid::widget::widget::Widget<T> + 'static)> as druid::widget::widget::Widget<T>>
  <Canvas<T> as druid::widget::widget::Widget<T>>
  <CanvasWrap<W, T, F> as druid::widget::widget::Widget<T>>
  <ComputedWidget<T, U> as druid::widget::widget::Widget<T>>
  <DisablePrismWrap<W, U, P> as druid::widget::widget::Widget<T>>
  <DynamicSizedBox<T> as druid::widget::widget::Widget<T>>
the trait bound `Label<_>: druid::widget::widget::Widget<_>` is not satisfied
the following other types implement trait `druid::widget::widget::Widget<T>`:
  <AdvancedSlider as druid::widget::widget::Widget<f64>>
  <Box<(dyn PrismWidget<T> + 'static)> as druid::widget::widget::Widget<T>>
  <Box<(dyn druid::widget::widget::Widget<T> + 'static)> as druid::widget::widget::Widget<T>>
  <Canvas<T> as druid::widget::widget::Widget<T>>
  <CanvasWrap<W, T, F> as druid::widget::widget::Widget<T>>
  <ComputedWidget<T, U> as druid::widget::widget::Widget<T>>
  <DisablePrismWrap<W, U, P> as druid::widget::widget::Widget<T>>
  <DynamicSizedBox<T> as druid::widget::widget::Widget<T>>
richard-uk1 commented 2 years ago

Hey @graymind75,

In regards to your first question, I suspect that you are pulling in two different versions of druid. If you do cargo tree -i druid you'll see if there is more than 1 version, and what other crates are pulling it in as a dependency. We pin druid-widget-nursery to a specific version of the master branch (now called main IIRC), and so you need to do the same in your project. Otherwise there are two druid::widget::widget::Widget traits (which is not desirable and at least to me is very confusing).

For your second question, the reason that druid hasn't grown much recently is that more focus has been going into piet-gpu and the xilem architecture. These are both hopefully going to be the foundation for a better druid in the future, but they are still in an experimental/development state, where the design space is being explored and breaking changes happening regularly. For more information read this great blog post: https://raphlinus.github.io/rust/gui/2022/07/15/next-dozen-guis.html

Hope this is helpful.