wip
This commit is contained in:
parent
6fb4a4a43e
commit
4fcd09d690
10 changed files with 999 additions and 763 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use std::{
|
||||
borrow::Borrow,
|
||||
cell::RefCell,
|
||||
rc::Rc,
|
||||
thread::{self, ThreadId},
|
||||
|
|
@ -14,6 +15,12 @@ pub struct RcWrapper<T> {
|
|||
pub(crate) thread_id: ThreadId,
|
||||
}
|
||||
|
||||
impl<T: Default> Default for RcWrapper<T> {
|
||||
fn default() -> Self {
|
||||
Self::new(T::default())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Clone for RcWrapper<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
|
|
@ -75,6 +82,12 @@ impl<M> RcElementWrapper<M> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<M: 'static> Borrow<dyn Widget<M, crate::Theme, crate::Renderer>> for RcElementWrapper<M> {
|
||||
fn borrow(&self) -> &(dyn Widget<M, crate::Theme, crate::Renderer> + 'static) {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> Widget<M, crate::Theme, crate::Renderer> for RcElementWrapper<M> {
|
||||
fn size(&self) -> Size<Length> {
|
||||
self.element.with_data(|e| e.as_widget().size())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue