wip rebase updates

This commit is contained in:
Ashley Wulber 2026-02-10 15:37:41 -05:00
parent 86dcf8af6c
commit e10459fb37
68 changed files with 1776 additions and 1544 deletions

View file

@ -11,62 +11,62 @@ pub trait Dropdown {
fn open(&mut self);
}
/// Produces a [`Task`] that closes a [`Dropdown`] popup.
pub fn close<T>(id: Id) -> impl Operation<T> {
struct Close(Id);
// /// Produces a [`Task`] that closes a [`Dropdown`] popup.
// pub fn close<T>(id: Id) -> impl Operation<T> {
// struct Close(Id);
impl<T> Operation<T> for Close {
fn custom(&mut self, state: &mut dyn std::any::Any, id: Option<&Id>) {
if id.map_or(true, |id| id != &self.0) {
return;
}
// impl<T> Operation<T> for Close {
// fn custom(&mut self, state: &mut dyn std::any::Any, id: Option<&Id>) {
// if id.map_or(true, |id| id != &self.0) {
// return;
// }
let Some(state) = state.downcast_mut::<State>() else {
return;
};
// let Some(state) = state.downcast_mut::<State>() else {
// return;
// };
state.close();
}
// state.close();
// }
fn container(
&mut self,
_id: Option<&Id>,
_bounds: Rectangle,
operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
) {
operate_on_children(self)
}
}
// fn container(
// &mut self,
// _id: Option<&Id>,
// _bounds: Rectangle,
// operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
// ) {
// operate_on_children(self)
// }
// }
Close(id)
}
// Close(id)
// }
/// Produces a [`Task`] that opens a [`Dropdown`] popup.
pub fn open<T>(id: Id) -> impl Operation<T> {
struct Open(Id);
// /// Produces a [`Task`] that opens a [`Dropdown`] popup.
// pub fn open<T>(id: Id) -> impl Operation<T> {
// struct Open(Id);
impl<T> Operation<T> for Open {
fn custom(&mut self, state: &mut dyn std::any::Any, id: Option<&Id>) {
if id.map_or(true, |id| id != &self.0) {
return;
}
// impl<T> Operation<T> for Open {
// fn custom(&mut self, state: &mut dyn std::any::Any, id: Option<&Id>) {
// if id.map_or(true, |id| id != &self.0) {
// return;
// }
let Some(state) = state.downcast_mut::<State>() else {
return;
};
// let Some(state) = state.downcast_mut::<State>() else {
// return;
// };
state.open();
}
// state.open();
// }
fn container(
&mut self,
_id: Option<&Id>,
_bounds: Rectangle,
operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
) {
operate_on_children(self)
}
}
// fn container(
// &mut self,
// _id: Option<&Id>,
// _bounds: Rectangle,
// operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
// ) {
// operate_on_children(self)
// }
// }
Open(id)
}
// Open(id)
// }