feat: menu bar popups

This commit is contained in:
Ashley Wulber 2025-06-10 12:22:07 -04:00 committed by GitHub
parent 5b77f37fde
commit 92ec78ba29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1861 additions and 928 deletions

View file

@ -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())